Compare Revisions

document.querySelector()

Revision 47449:

Revision 47449 by Marcoos on

Revision 47450:

Revision 47450 by nhoizey on

Title:
Document.querySelector
Document.querySelector
Slug:
DOM/Document.querySelector
DOM/Document.querySelector
Tags:
DOM, "Gecko DOM Reference", Selectors, Fixit
DOM, "Gecko DOM Reference", Selectors, Fixit
Content:

Revision 47449
Revision 47450
n10    <h3 name="Summary">n10    <h3 id="Summary" name="Summary">
n16    <h3 name="Syntax">n16    <h3 id="Syntax" name="Syntax">
n33    <h3 name="Example">n33    <h3 id="Example" name="Example">
n37      In this example, the first element in the document with then37      In this example, the first element in the document with the
> ID "<code>myid</code>" is returned:> class "<code>myclass</code>" is returned:
n40var el = document.querySelector("#myid");n40var el = document.querySelector(".myclass");
n42    <h3 name="Notes">n42    <h3 id="Notes" name="Notes">
nn47    </p>
48    <p>
49      If the selector matches an ID and this ID is erroneously us
 >ed several times in the document, it returns the first matching e
 >lement.
n54    <h3 name="Browser_Compatibility">n57    <h3 id="Browser_Compatibility" name="Browser_Compatibility">
n154    <h3 name="Specification">n157    <h3 id="Specification" name="Specification">
t162    <h3 name="See_also">t165    <h3 id="See_also" name="See_also">

Back to History