Guest User

Untitled

a guest
Jun 18th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. <script>
  2. //find first element with "someAttr" attribute
  3. document.querySelector('[someAttr]');
  4.  
  5. //find all elements with "someAttr" attribute
  6. document.querySelectorAll('[someAttr]');
  7.  
  8.  
  9. //so this is how you can get a specific element without using id or class
  10. document.querySelector([attribute="value"])
  11. .innerHTML = "element text changed!";
  12. </script>
Add Comment
Please, Sign In to add comment