Last active
November 9, 2019 07:37
-
-
Save usmanity/370ca08ea69db5355a85e111d2ecf911 to your computer and use it in GitHub Desktop.
move to the next page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* this version wasn't working | |
$(document).on('keydown', function(e) { | |
if (e.key == "ArrowRight" || e.key == " ") { | |
let next = $('a').filter((b, anchor) => $(anchor).text().includes('next') ) | |
next.click(); | |
} | |
}); | |
*/ | |
// working version | |
$(document).on('keydown', function(e) {if (e.key == "ArrowRight" || e.key == " ") {let next = $('a').filter((b, anchor) => $(anchor).text().includes('next') ); console.log(next); location = next[0].href;}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment