JavaScript basics: Select one or multiple HTML elements

preview_player
Показать описание
If you search Stackoverflow for selecting html elements on a page you will be overloaded by jQuery example’s.

Since I’m a bigger fan of learning Vanilla JavaScript to get into JavaScript in general, I want to show you how to do it with the querySelector and querySelectorAll.

The querySelector methods are just that easy as the jQuery selector.

Рекомендации по теме
Комментарии
Автор

Hello I have a question if your li element would have same class can you put class name in querySelector instead of showing all path (like u did Class li)

MZ-yxeg
welcome to shbcf.ru