Created
March 7, 2009 18:50
-
-
Save subtleGradient/75406 to your computer and use it in GitHub Desktop.
SubtleClickAll; Takes a CSS selector and executes the click method on each matching element.
This file contains 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
javascript:function%20SubtleClickAll(SELECTOR,timeout){timeout=timeout||0;var%20node,nodes=Array.prototype.slice.call(document.querySelectorAll(SELECTOR));function%20NEXT(){node=nodes.pop();if(node)setTimeout(function(){node.click();NEXT();},timeout);};NEXT();};SubtleClickAll(prompt(%22SubtleClickAll%20(Thomas%20Aylott%20subtleGradient.com)%22,%22CSS3%20Selector%22),10); |
This file contains 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
<a href="javascript:function%20SubtleClickAll(SELECTOR,timeout){timeout=timeout||0;var%20node,nodes=Array.prototype.slice.call(document.querySelectorAll(SELECTOR));function%20NEXT(){node=nodes.pop();if(node)setTimeout(function(){node.click();NEXT();},timeout);};NEXT();};SubtleClickAll(prompt(%22SubtleClickAll%20(Thomas%20Aylott%20subtleGradient.com)%22,%22CSS3%20Selector%22),10);" title="SubtleClickAll (Thomas Aylott subtleGradient.com)">SubtleClickAll</a> | |
<hr /> | |
Known to work in Safari beta 4. Has not been tested anywhere else.<br /> | |
Could also work in IE8 or Firefox 3.1+ or Safari 3.1+ |
This file contains 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
function SubtleClickAll(SELECTOR,timeout){ | |
timeout=timeout||0; | |
var node,nodes=Array.prototype.slice.call(document.querySelectorAll(SELECTOR)); | |
function NEXT(){ | |
node=nodes.pop(); | |
if(node)setTimeout(function(){node.click();NEXT();},timeout); | |
};NEXT(); | |
}; | |
SubtleClickAll(prompt("SubtleClickAll (Thomas Aylott subtleGradient.com)","CSS3 Selector"),10); |
This file contains 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
javascript:function%20SubtleClickAllJr(SELECTOR)%20{Array.prototype.slice.call(document.querySelectorAll(SELECTOR)).forEach(function(node)%20{node.click();});};SubtleClickAllJr(prompt(%22SubtleClickAll%20(Thomas%20Aylott%20subtleGradient.com)%22,%22CSS3%20Selector%22)); |
This file contains 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
function SubtleClickAllJr(SELECTOR) { | |
Array.prototype.slice.call(document.querySelectorAll(SELECTOR)).forEach(function(node) { | |
node.click(); | |
}); | |
}; | |
SubtleClickAllJr(prompt("SubtleClickAllJr (Thomas Aylott subtleGradient.com)","CSS3 Selector")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment