Skip to content

Commit a472689

Browse files
merciermksideshowbarker
authored andcommitted
var to const in exemple
I suggest changing VAR to CONST to show the best practice.
1 parent d03822c commit a472689

File tree

1 file changed

+2
-2
lines changed
  • files/en-us/web/api/document_object_model/locating_dom_elements_using_selectors

1 file changed

+2
-2
lines changed

files/en-us/web/api/document_object_model/locating_dom_elements_using_selectors/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@

Selectors

2727

2828
<p>The selector methods accept one or more comma-separated selectors to determine what element or elements should be returned. For example, to select all paragraph (<code>pcode>) elements in a document whose CSS class is either <code>warningcode> or <code>notecode>, you can do the following:p>
2929

30-
<pre class="brush: js">var special = document.querySelectorAll("p.warning, p.note");pre>
30+
<pre class="brush: js">const special = document.querySelectorAll("p.warning, p.note");pre>
3131

3232
<p>You can also query by ID. For example:p>
3333

34-
<pre class="brush: js">var el = document.querySelector("#main, #basic, #exclamation");pre>
34+
<pre class="brush: js">const el = document.querySelector("#main, #basic, #exclamation");pre>
3535

3636
<p>After executing the above code, <code>elcode> contains the first element in the document whose ID is one of <code>maincode>, <code>basiccode>, or <code>exclamationcode>.p>
3737

0 commit comments

Comments
 (0)