How JQuery selectors work -


this question has answer here:

i new jquery. learned jquery selector, used selecting dom elements. dont understand how internally finds dom element. if give $("#pelement") or $(".pclass") how jquery finds dom element ? use document.getelementbyid() or ? please me understand. lot.

it's library, yes, if id you're looking for, uses document.getelementbyid()

if queryselector() available in browser, uses that, otherwise uses getelementsbyclassname() classes.

in other words takes ever available in browser , uses efficient one, , abstracts can use css selectors in code without having think stuff browser supports, , method use etc.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -