querySelector by id code example
Example 1: js queryselector names
document.querySelector('[name="your-selector-name-here"]');
Example 2: javascript queryselector
const myParagraph = document.querySelector('.example');
myParagraph.textContent = 'This is my new text';
Example 3: query selector js
element = document.querySelector(sélecteurs);
Example 4: queryselector javascript varias clases
element = document.querySelector(selectores);
Example 5: document.queryselector
<div id="foo\bar"></div>
<div id="foo:bar"></div>
<script>
console.log('#foo\bar');
document.querySelector('#foo\bar');
console.log('#foo\\bar');
console.log('#foo\\\\bar');
document.querySelector('#foo\\\\bar');
document.querySelector('#foo:bar');
document.querySelector('#foo\\:bar');
</script>
Example 6: queryselector
document.querySelector(".example");