Created
October 19, 2021 15:57
-
-
Save apsolut/1bc1dbe27749e8e0c3a4a6526038d91d to your computer and use it in GitHub Desktop.
javascript vanilla js quicks
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
| var elementNameHere = document.getElementsByClassName("classs-first-element-check"); | |
| if ( elementNameHere ) { | |
| for ( var i = 0, len = elementNameHere.length; i < len; i++ ) { | |
| console.log( len[i] ); | |
| } | |
| } | |
| var yourForearchLoop = document.querySelectorAll('.your-class-name-here'); | |
| yourForearchLoop.forEach(function ( yourForearchLoop, index ) { | |
| console.log( yourForearchLoop ); | |
| console.log( index ); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment