dom - Javascript querySelector vs. getElementById -
i have heard queryselector
& queryselectorall
new, , better, methods select dom
elements. true?
are queryselector
& queryselectorall
improve getelementbyid
& getelementsbyclassname
?
which should using? i'm new web programming! give thanks you!!!
"better" subjective.
queryselector
newer feature.
getelementbyid
improve supported queryselector
.
queryselector
improve supported getelementsbyclassname
.
queryselector
lets find elements rules can't expressed getelementbyid
, getelementsbyclassname
you need pick appropriate tool given task.
(in above, queryselector
read queryselector
/ queryselectorall
).
javascript dom
No comments:
Post a Comment