Created
July 24, 2016 06:11
-
-
Save juner/d56cfcf1f83f342e5e71cc7a790529ca to your computer and use it in GitHub Desktop.
コンソールを用いたワンライナー TIPS(IE11) ref: http://qiita.com/juner/items/d64c4e2cad1c9c2674bc
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
[].filter.call($$(selector),function(element){ return element.textContent.indexOf("hoge") != -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
[].forEach.call($$(selector),function(element){ console.dir(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
["id1","id2","id3"].map(function(id){ return document.getElementById(id); }); |
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
[].map.call($$(selector),function(element){ return ["attrName1","attrName2"].reduce(function(obj,name){ return obj[name] = element.getAttribute(name),obj; },{}); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment