jadjoubran / codetogo.io

🚀 JavaScript code to go - Find updated snippets for common JavaScript use cases
https://codetogo.io
MIT License
233 stars 30 forks source link

Use Case Suggestion: How to use ID to identify elements with DOM in JavaScript #147

Closed politologu closed 6 years ago

politologu commented 6 years ago

<h1 id="h1-heading">Hello Codetogo!</h1>

const headingElement = document.getElementById("h1-heading");

jadjoubran commented 6 years ago

Thanks @politologu! There's already one for it here: How to find element by id in JavaScript