¡GoConqr estrena diseño! Cuéntanos qué te parece.

Apuntes

The DOM - Selecting Elements

Eduardo Souza Web Development - Javascript Técnico Portugués 1 página

Contenido del apunte (1)

Página 1

The javascript file need to be taged before the closing body tag in the HTML code in a <script> tag.

There is a another way to load js file on the page: putting all the js code inside of a function and then adding an event listener that listens for the DOM content loaded event runs the init() function we created when that happens. This way, the script tag can be placed in the head tag and or page will still run.

We can use querySelector() and querySelectorAll() to select a CSS selector (how argument on the method) and listen for clicks, change the content , add content and etc.

The way we use to select CSS selectors is using its name with the symbol that represents the type of selector. Like '.' to classes and '#' to IDs. Or we can still just take a tag name or anything else in HTML code.

Información

Descripción
Técnico Web Development - Javascript Apunte sobre The DOM - Selecting Elements, creado por Eduardo Souza el 06/01/2022.
Creado por
Eduardo Souza
Visitas
0
Etiquetas
javascript
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?