-
parent.getElementById('id');
- It allows us to obtain an element by its identification.
-
parent.getElementsByClassName(‘class’):
- It allows us to obtain an Array with all the child elements that have the same class.
- “getElementByClassName” does not exist, that is to say we will not be able to obtain only 1 element with that class.
-
parent.getElementsByTagName(‘div’);
- It allows us to obtain an Array with all the child elements that have the same Tag name.
- “parent.getElementsByTagName” does not exist, that is to say we will not be able to obtain only 1 element with that Tag name.
-
parent.querySelector(' ')
🌟- It allows us to search in 3 ways and returns the first item that matches the search pattern.
- By id
- By Class name
- By Tag name
- It allows us to search in 3 ways and returns the first item that matches the search pattern.
-
parent.querySelectorAll(' ')
🌟- It allows us to search in 3 ways and returns a NodeList with items that matches the search pattern.
- By id
- By Class name
- By Tag name
- It allows us to search in 3 ways and returns a NodeList with items that matches the search pattern.
0 Comentarios
para escribir tu comentario