Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #33153
| Newsgroups | comp.lang.javascript |
|---|---|
| Date | 2017-04-30 18:52 -0700 |
| References | <2372a119-d289-48a8-964c-f6ee4ad8bc5a@googlegroups.com> <2214181f-3c02-4344-a780-008863bdd893@googlegroups.com> |
| Message-ID | <3a90ba8f-e63f-440b-801a-06ed5a2542fd@googlegroups.com> (permalink) |
| Subject | Re: A generic question |
| From | justaguy <lichunshen84@gmail.com> |
On Sunday, April 30, 2017 at 11:01:20 AM UTC-4, Ram Tobolski wrote: > >I know there are at least three methods to identify or reference an object in DOM, namely, > (a) by id or name etc. for instance, getElementById() or getElementsByName or getElementsByTagName; > (b) by relationship, for instance, parentNode > (c) by class, for instance, document.getElementsByClassName > > >Just curious if there's additional method to achieve the same. > > You can retrieve dom elements by any CSS query, with document.querySelector and document.querySelectorAll. See https://www.w3schools.com/jsref/met_document_queryselector.asp Good to know. Thanks.
Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread
A generic question justaguy <lichunshen84@gmail.com> - 2017-04-29 09:56 -0700
Re: A generic question JJ <jj4public@vfemail.net> - 2017-04-30 07:59 +0700
Re: A generic question justaguy <lichunshen84@gmail.com> - 2017-04-29 19:21 -0700
Re: A generic question Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-04-30 20:16 +0200
Re: A generic question Frank Kozuschnik <franko@nurfuerspam.de> - 2017-04-30 22:53 +0200
Legacy properties on Window objects (was: A generic question) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-05-01 06:10 +0200
Re: A generic question JJ <jj4public@vfemail.net> - 2017-05-01 18:14 +0700
Re: A generic question Frank Kozuschnik <franko@nurfuerspam.de> - 2017-05-01 18:07 +0200
A generic question Ram Tobolski <ramtob@gmail.com> - 2017-04-30 08:01 -0700
Re: A generic question justaguy <lichunshen84@gmail.com> - 2017-04-30 18:52 -0700
csiph-web