HTML Preparation code:
AخA
 
1
<!doctype html>
2
<html lang="en">
3
  <head>
4
    <meta charset="utf-8">
5
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
    <title>HTML5 Test Page</title>
7
  </head>
8
  <body>
9
    <div id="top" class="page" role="document">
10
      <header role="banner">
11
        <h1>HTML5 Test Page</h1>
12
        <p>This is a test page filled with common HTML elements to be used to provide visual feedback whilst building CSS systems and frameworks.</p>
13
      </header>
14
      <nav role="navigation">
15
        <ul>
16
          <li>
17
            <a href="#text">Text</a>
18
            <ul>
19
              <li><a href="#text__headings">Headings</a></li>
20
              <li><a href="#text__paragraphs">Paragraphs</a></li>
21
              <li><a href="#text__blockquotes">Blockquotes</a></li>
22
              <li><a href="#text__lists">Lists</a></li>
23
              <li><a href="#text__hr">Horizontal rules</a></li>
24
              <li><a href="#text__tables">Tabular data</a></li>
25
              <li><a href="#text__code">Code</a></li>
26
              <li><a href="#text__inline">Inline elements</a></li>
27
              <li><a href="#text__comments">HTML Comments</a></li>
28
            </ul>
29
          </li>
30
          <li>
31
            <a href="#embedded">Embedded content</a>
32
            <ul>
33
              <li><a href="#embedded__images">Images</a></li>
34
              <li><a href="#embedded__audio">Audio</a></li>
35
              <li><a href="#embedded__video">Video</a></li>
36
              <li><a href="#embedded__canvas">Canvas</a></li>
37
              <li><a href="#embedded__meter">Meter</a></li>
38
              <li><a href="#embedded__progress">Progress</a></li>
39
              <li><a href="#embedded__svg">Inline SVG</a></li>
40
              <li><a href="#embedded__iframe">IFrames</a></li>
41
            </ul>
42
          </li>
43
          <li>
44
            <a href="#forms">Form elements</a>
45
            <ul>
46
              <li><a href="#forms__input">Input fields</a></li>
47
              <li><a href="#forms__select">Select menus</a></li>
48
              <li><a href="#forms__checkbox">Checkboxes</a></li>
49
              <li><a href="#forms__radio">Radio buttons</a></li>
50
              <li><a href="#forms__textareas">Textareas</a></li>
51
              <li><a href="#forms__html5">HTML5 inputs</a></li>
52
              <li><a href="#forms__action">Action buttons</a></li>
53
            </ul>
54
          </li>
55
        </ul>
56
      </nav>
57
      <main role="main">
58
        <section id="text">
59
          <header><h1>Text</h1></header>
60
          <article id="text__headings">
61
            <header>
62
              <h1>Headings</h1>
63
            </header>
64
            <div>
65
              <h1>Heading 1</h1>
66
              <h2>Heading 2</h2>
67
              <h3>Heading 3</h3>
68
              <h4>Heading 4</h4>
69
              <h5>Heading 5</h5>
70
              <h6>Heading 6</h6>
71
            </div>
72
            <footer><p><a href="#top">[Top]</a></p></footer>
73
          </article>
74
          <article id="text__paragraphs">
75
            <header><h1>Paragraphs</h1></header>
76
            <div>
77
              <p>A paragraph (from the Greek paragraphos, “to write beside” or “written beside”) is a self-contained unit of a discourse in writing dealing with a particular point or idea. A paragraph consists of one or more sentences. Though not required by the syntax of any language, paragraphs are usually an expected part of formal writing, used to organize longer prose.</p>
78
            </div>
79
            <footer><p><a href="#top">[Top]</a></p></footer>
80
          </article>
81
          <article id="text__blockquotes">
82
            <header><h1>Blockquotes</h1></header>
83
            <div>
84
              <blockquote>
85
                <p>A block quotation (also known as a long quotation or extract) is a quotation in a written document, that is set off from the main text as a paragraph, or block of text.</p>
86
                <p>It is typically distinguished visually using indentation and a different typeface or smaller size quotation. It may or may not include a citation, usually placed at the bottom.</p>
87
                <cite><a href="#!">Said no one, ever.</a></cite>
88
              </blockquote>
89
            </div>
90
            <footer><p><a href="#top">[Top]</a></p></footer>
91
          </article>
92
          <article id="text__lists">
93
            <header><h1>Lists</h1></header>
94
            <div>
95
              <h3>Definition list</h3>
96
              <dl>
97
                <dt>Definition List Title</dt>
98
                <dd>This is a definition list division.</dd>
99
              </dl>
100
              <h3>Ordered List</h3>
101
              <ol>
102
                <li>List Item 1</li>
103
                <li>List Item 2</li>
104
                <li>List Item 3</li>
105
              </ol>
106
              <h3>Unordered List</h3>
107
              <ul>
108
                <li>List Item 1</li>
109
                <li>List Item 2</li>
110
                <li>List Item 3</li>
111
              </ul>
112
            </div>
113
            <footer><p><a href="#top">[Top]</a></p></footer>
114
          </article>
115
          <article id="text__hr">
116
            <header><h1>Horizontal rules</h1></header>
117
            <div>
118
              <hr>
119
            </div>
120
            <footer><p><a href="#top">[Top]</a></p></footer>
121
          </article>
122
          <article id="text__tables">
123
            <header><h1>Tabular data</h1></header>
124
            <table>
125
              <caption>Table Caption</caption>
126
              <thead>
127
                <tr>
128
                  <th>Table Heading 1</th>
129
                  <th>Table Heading 2</th>
130
                  <th>Table Heading 3</th>
131
                  <th>Table Heading 4</th>
132
                  <th>Table Heading 5</th>
133
                </tr>
134
              </thead>
135
              <tfoot>
136
                <tr>
137
                  <th>Table Footer 1</th>
138
                  <th>Table Footer 2</th>
139
                  <th>Table Footer 3</th>
140
                  <th>Table Footer 4</th>
141
                  <th>Table Footer 5</th>
142
                </tr>
143
              </tfoot>
144
              <tbody>
145
                <tr>
146
                  <td>Table Cell 1</td>
147
                  <td>Table Cell 2</td>
148
                  <td>Table Cell 3</td>
149
                  <td>Table Cell 4</td>
150
                  <td>Table Cell 5</td>
151
                </tr>
152
                <tr>
153
                  <td>Table Cell 1</td>
154
                  <td>Table Cell 2</td>
155
                  <td>Table Cell 3</td>
156
                  <td>Table Cell 4</td>
157
                  <td>Table Cell 5</td>
158
                </tr>
159
                <tr>
160
                  <td>Table Cell 1</td>
161
                  <td>Table Cell 2</td>
162
                  <td>Table Cell 3</td>
163
                  <td>Table Cell 4</td>
164
                  <td>Table Cell 5</td>
165
                </tr>
166
                <tr>
167
                  <td>Table Cell 1</td>
168
                  <td>Table Cell 2</td>
169
                  <td>Table Cell 3</td>
170
                  <td>Table Cell 4</td>
171
                  <td>Table Cell 5</td>
172
                </tr>
173
              </tbody>
174
            </table>
175
            <footer><p><a href="#top">[Top]</a></p></footer>
176
          </article>
177
          <article id="text__code">
178
            <header><h1>Code</h1></header>
179
            <div>
180
              <p><strong>Keyboard input:</strong> <kbd>Cmd</kbd></p>
181
              <p><strong>Inline code:</strong> <code>&lt;div&gt;code&lt;/div&gt;</code></p>
182
              <p><strong>Sample output:</strong> <samp>This is sample output from a computer program.</samp></p>
183
              <h2>Pre-formatted text</h2>
184
              <pre>P R E F O R M A T T E D T E X T
185
  ! " # $ % &amp; ' ( ) * + , - . /
186
  0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ?
187
  @ A B C D E F G H I J K L M N O
188
  P Q R S T U V W X Y Z [ \ ] ^ _
189
  ` a b c d e f g h i j k l m n o
190
  p q r s t u v w x y z { | } ~ </pre>
191
            </div>
192
            <footer><p><a href="#top">[Top]</a></p></footer>
193
          </article>
194
          <article id="text__inline">
195
            <header><h1>Inline elements</h1></header>
196
            <div>
197
              <p><a href="#!">This is a text link</a>.</p>
198
              <p><strong>Strong is used to indicate strong importance.</strong></p>
199
              <p><em>This text has added emphasis.</em></p>
200
              <p>The <b>b element</b> is stylistically different text from normal text, without any special importance.</p>
201
              <p>The <i>i element</i> is text that is offset from the normal text.</p>
202
              <p>The <u>u element</u> is text with an unarticulated, though explicitly rendered, non-textual annotation.</p>
203
              <p><del>This text is deleted</del> and <ins>This text is inserted</ins>.</p>
204
              <p><s>This text has a strikethrough</s>.</p>
205
              <p>Superscript<sup>®</sup>.</p>
206
              <p>Subscript for things like H<sub>2</sub>O.</p>
207
              <p><small>This small text is small for for fine print, etc.</small></p>
208
              <p>Abbreviation: <abbr title="HyperText Markup Language">HTML</abbr></p>
209
              <p><q cite="https://developer.mozilla.org/en-US/docs/HTML/Element/q">This text is a short inline quotation.</q></p>
210
              <p><cite>This is a citation.</cite></p>
211
              <p>The <dfn>dfn element</dfn> indicates a definition.</p>
212
              <p>The <mark>mark element</mark> indicates a highlight.</p>
213
              <p>The <var>variable element</var>, such as <var>x</var> = <var>y</var>.</p>
214
              <p>The time element: <time datetime="2013-04-06T12:32+00:00">2 weeks ago</time></p>
215
            </div>
216
            <footer><p><a href="#top">[Top]</a></p></footer>
217
          </article>
218
          <article id="text__comments">
219
            <header><h1>HTML Comments</h1></header>
220
            <div>
221
              <p>There is comment here: <!--This comment should not be displayed--></p>
222
              <p>There is a comment spanning multiple tags and lines below here.</p>
223
              <!--<p><a href="#!">This is a text link. But it should not be displayed in a comment</a>.</p>
224
              <p><strong>Strong is used to indicate strong importance. But, it should not be displayed in a comment</strong></p>
225
              <p><em>This text has added emphasis. But, it should not be displayed in a comment</em></p>-->
226
            </div>
227
            <footer><p><a href="#top">[Top]</a></p></footer>
228
          </article>
229
        </section>
230
        <section id="embedded">
231
          <header><h1>Embedded content</h1></header>
232
          <article id="embedded__images">
233
            <header><h2>Images</h2></header>
234
            <div>
235
              <h3>No <code>&lt;figure&gt;</code> element</h3>
236
              <p><img src="http://placekitten.com/480/480" alt="Image alt text"></p>
237
              <h3>Wrapped in a <code>&lt;figure&gt;</code> element, no <code>&lt;figcaption&gt;</code></h3>
238
              <figure><img src="http://placekitten.com/420/420" alt="Image alt text"></figure>
239
              <h3>Wrapped in a <code>&lt;figure&gt;</code> element, with a <code>&lt;figcaption&gt;</code></h3>
240
              <figure>
241
                <img src="http://placekitten.com/420/420" alt="Image alt text">
242
                <figcaption>Here is a caption for this image.</figcaption>
243
              </figure>
244
            </div>
245
            <footer><p><a href="#top">[Top]</a></p></footer>
246
          </article>
247
          <article id="embedded__audio">
248
            <header><h2>Audio</h2></header>
249
            <div><audio controls="">audio</audio></div>
250
            <footer><p><a href="#top">[Top]</a></p></footer>
251
          </article>
252
          <article id="embedded__video">
253
            <header><h2>Video</h2></header>
254
            <div><video controls="">video</video></div>
255
            <footer><p><a href="#top">[Top]</a></p></footer>
256
          </article>
257
          <article id="embedded__canvas">
258
            <header><h2>Canvas</h2></header>
259
            <div><canvas>canvas</canvas></div>
260
            <footer><p><a href="#top">[Top]</a></p></footer>
261
          </article>
262
          <article id="embedded__meter">
263
            <header><h2>Meter</h2></header>
264
            <div><meter value="2" min="0" max="10">2 out of 10</meter></div>
265
            <footer><p><a href="#top">[Top]</a></p></footer>
266
          </article>
267
          <article id="embedded__progress">
268
            <header><h2>Progress</h2></header>
269
            <div><progress>progress</progress></div>
270
            <footer><p><a href="#top">[Top]</a></p></footer>
271
          </article>
272
          <article id="embedded__svg">
273
            <header><h2>Inline SVG</h2></header>
274
            <div><svg width="100px" height="100px"><circle cx="100" cy="100" r="100" fill="#1fa3ec"></circle></svg></div>
275
            <footer><p><a href="#top">[Top]</a></p></footer>
276
          </article>
277
          <article id="embedded__iframe">
278
            <header><h2>IFrame</h2></header>
279
            <div><iframe src="index.html" height="300"></iframe></div>
280
            <footer><p><a href="#top">[Top]</a></p></footer>
281
          </article>
282
        </section>
283
        <section id="forms">
284
          <header><h1>Form elements</h1></header>
285
          <form>
286
            <fieldset id="forms__input">
287
              <legend>Input fields</legend>
288
              <p>
289
                <label for="input__text">Text Input</label>
290
                <input id="input__text" type="text" placeholder="Text Input">
291
              </p>
292
              <p>
293
                <label for="input__password">Password</label>
294
                <input id="input__password" type="password" placeholder="Type your Password">
295
              </p>
296
              <p>
297
                <label for="input__webaddress">Web Address</label>
298
                <input id="input__webaddress" type="url" placeholder="http://yoursite.com">
299
              </p>
300
              <p>
301
                <label for="input__emailaddress">Email Address</label>
302
                <input id="input__emailaddress" type="email" placeholder="name@email.com">
303
              </p>
304
              <p>
305
                <label for="input__phone">Phone Number</label>
306
                <input id="input__phone" type="tel" placeholder="(999) 999-9999">
307
              </p>
308
              <p>
309
                <label for="input__search">Search</label>
310
                <input id="input__search" type="search" placeholder="Enter Search Term">
311
              </p>
312
              <p>
313
                <label for="input__text2">Number Input</label>
314
                <input id="input__text2" type="number" placeholder="Enter a Number">
315
              </p>
316
              <p>
317
                <label for="input__text3" class="error">Error</label>
318
                <input id="input__text3" class="is-error" type="text" placeholder="Text Input">
319
              </p>
320
              <p>
321
                <label for="input__text4" class="valid">Valid</label>
322
                <input id="input__text4" class="is-valid" type="text" placeholder="Text Input">
323
              </p>
324
            </fieldset>
325
            <p><a href="#top">[Top]</a></p>
326
            <fieldset id="forms__select">
327
              <legend>Select menus</legend>
328
              <p>
329
                <label for="select">Select</label>
330
                <select id="select">
331
                  <optgroup label="Option Group">
332
                    <option>Option One</option>
333
                    <option>Option Two</option>
334
                    <option>Option Three</option>
335
                  </optgroup>
336
                </select>
337
              </p>
338
            </fieldset>
339
            <p><a href="#top">[Top]</a></p>
340
            <fieldset id="forms__checkbox">
341
              <legend>Checkboxes</legend>
342
              <ul class="list list--bare">
343
                <li><div class="test" id="test"></div></li>
344
                <li><label for="checkbox1"><input id="checkbox1" name="checkbox" type="checkbox" checked="checked"> Choice A</label></li>
345
                <li><label for="checkbox2"><input id="checkbox2" name="checkbox" type="checkbox"> Choice B</label></li>
346
                <li><label for="checkbox3"><input id="checkbox3" name="checkbox" type="checkbox"> Choice C</label></li>
347
              </ul>
348
            </fieldset>
349
            <p><a href="#top">[Top]</a></p>
350
            <fieldset id="forms__radio">
351
              <legend>Radio buttons</legend>
352
              <ul class="list list--bare">
353
                <li><label for="radio1"><input id="radio1" name="radio" type="radio" class="radio" checked="checked"> Option 1</label></li>
354
                <li><label for="radio2"><input id="radio2" name="radio" type="radio" class="radio"> Option 2</label></li>
355
                <li><label for="radio3"><input id="radio3" name="radio" type="radio" class="radio"> Option 3</label></li>
356
              </ul>
357
            </fieldset>
358
            <p><a href="#top">[Top]</a></p>
359
            <fieldset id="forms__textareas">
360
              <legend>Textareas</legend>
361
              <p>
362
                <label for="textarea">Textarea</label>
363
                <textarea id="textarea" rows="8" cols="48" placeholder="Enter your message here"></textarea>
364
              </p>
365
            </fieldset>
366
            <p><a href="#top">[Top]</a></p>
367
            <fieldset id="forms__html5">
368
              <legend>HTML5 inputs</legend>
369
              <p>
370
                <label for="ic">Color input</label>
371
                <input type="color" id="ic" value="#000000">
372
              </p>
373
              <p>
374
                <label for="in">Number input</label>
375
                <input type="number" id="in" min="0" max="10" value="5">
376
              </p>
377
              <p>
378
                <label for="ir">Range input</label>
379
                <input type="range" id="ir" value="10">
380
              </p>
381
              <p>
382
                <label for="idd">Date input</label>
383
                <input type="date" id="idd" value="1970-01-01">
384
              </p>
385
              <p>
386
                <label for="idm">Month input</label>
387
                <input type="month" id="idm" value="1970-01">
388
              </p>
389
              <p>
390
                <label for="idw">Week input</label>
391
                <input type="week" id="idw" value="1970-W01">
392
              </p>
393
              <p>
394
                <label for="idt">Datetime input</label>
395
                <input type="datetime" id="idt" value="1970-01-01T00:00:00Z">
396
              </p>
397
              <p>
398
                <label for="idtl">Datetime-local input</label>
399
                <input type="datetime-local" id="idtl" value="1970-01-01T00:00">
400
              </p>
401
            </fieldset>
402
            <p><a href="#top">[Top]</a></p>
403
            <fieldset id="forms__action">
404
              <legend>Action buttons</legend>
405
              <p>
406
                <input type="submit" value="<input type=submit>">
407
                <input type="button" value="<input type=button>">
408
                <input type="reset" value="<input type=reset>">
409
                <input type="submit" value="<input disabled>" disabled>
410
              </p>
411
              <p>
412
                <button type="submit">&lt;button type=submit&gt;</button>
413
                <button type="button">&lt;button type=button&gt;</button>
414
                <button type="reset">&lt;button type=reset&gt;</button>
415
                <button type="button" disabled>&lt;button disabled&gt;</button>
416
              </p>
417
            </fieldset>
418
            <p><a href="#top">[Top]</a></p>
419
          </form>
420
        </section>
421
      </main>
422
      <footer role="contentinfo">
423
        <p>Made by <a href="http://twitter.com/cbracco">@cbracco</a>. Code on <a href="http://github.com/cbracco/html5-test-page">GitHub</a>.</p>
424
      </footer>
425
    </div>
426
  </body>
427
</html>
Tests:
  • querySelector

     
    document.querySelector(".test")
  • querySelectorAll

     
    document.querySelectorAll(".test")
  • getElementsByClassName

     
    document.getElementsByClassName(".test")
  • querySelector (ID)

     
    document.querySelector("#test")
  • getElementsByID

     
    document.getElementById("test")
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    querySelector
    querySelectorAll
    getElementsByClassName
    querySelector (ID)
    getElementsByID

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36
Chrome 88 on Windows
View result in a separate tab
Test name Executions per second
querySelector 367120.6 Ops/sec
querySelectorAll 283288.9 Ops/sec
getElementsByClassName 3997314.0 Ops/sec
querySelector (ID) 160849.7 Ops/sec
getElementsByID 3075070.5 Ops/sec