js queryselector names
// This selects the first element with that name
document.querySelector('[name="your-selector-name-here"]');
js queryselector names
// This selects the first element with that name
document.querySelector('[name="your-selector-name-here"]');
selet all elemnts
var elems = document.body.getElementsByTagName("*");
class query css js all
var matches = document.querySelectorAll("div.note, div.alert");
query selector has clas
document.body.classList.add('thisClass');
// $('body').addClass('thisClass');
document.body.classList.remove('thatClass');
// $('body').removeClass('thatClass');
document.body.classList.toggle('anotherClass');
// $('body').toggleClass('anotherClass');
what does queryselectorAll returns?
The querySelectorAll() method returns all elements in the document
that matches a specified CSS selector(s), as a static NodeList object.
The NodeList object represents a collection of nodes.
The nodes can be accessed by index numbers.
The index starts at 0.
javascript queryselector
//Pretend there is a <p> with class "example"
const myParagraph = document.querySelector('.example');
//You can do many this with is
myParagraph.textContent = 'This is my new text';
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us