-
Notifications
You must be signed in to change notification settings - Fork 0
/
tester.html
928 lines (829 loc) · 36.7 KB
/
tester.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>HTML5 elements tester</title>
<link rel="stylesheet" href="dist/a11yana.css">
</head>
<body id="body">
<a href="#main">Skip to main content</a>
<header>
<h1>HTML5 elements tester</h1>
<p>A test page containing most of the HTML5 elements that you'll ever need. Useful for testing CSS resets or CSS frameworks.</p>
<p>A project by <a href="https://alexandersandberg.com">Alexander Sandberg</a> · <a href="https://github.com/alexandersandberg/html5-elements-tester">GitHub repository</a></p>
</header>
<main id="main">
<nav id="nav">
<h2>Navigation</h2>
<ul>
<li><a href="#sections">Sections</a></li>
<li><a href="#grouping-content">Grouping content</a></li>
<li><a href="#text-level-semantics">Text-level semantics</a></li>
<li><a href="#edits">Edits</a></li>
<li><a href="#embedded-content">Embedded content</a></li>
<li><a href="#tabular-data">Tabular data</a></li>
<li><a href="#forms">Forms</a></li>
<li><a href="#interactive-elements">Interactive elements</a></li>
<li><a href="#scripting">Scripting</a></li>
</ul>
</nav>
<section id="sections">
<header>
<h2>Sections</h2>
<p>Elements: <code><body></code>, <code><article></code>, <code><section></code>, <code><nav></code>, <code><aside></code>, <code><h1>–<h6></code>, <code><header></code>, <code><footer></code></p>
</header>
<article>
<header>
<h3><code><h1>–<h6></code>:</h3>
</header>
<!--
Note that, in this context, this use of <h*>s is not of appropriate
(accessible) rank, but used for testing purposes.
-->
<h1><code><h1></code> A unique title, specific for the page</h1>
<h2><code><h2></code> Heading levels should reflect structure, not style</h2>
<p>It can also be useful to test how body text below a heading appears on the page, for example to check the margin. This text is wrapped in <p> and is a direct sibling to the above <h2>.</p>
<h3><code><h3></code> If you need a visually smaller title, use CSS</h3>
<p>To create a semantically correct HTML structure that's accessible for everyone, make sure you're nesting the headings correctly. Never use more than one <h1> per page, and don't skip heading levels.</p>
<h4><code><h4></code> Headings below level 4 are not used as much</h4>
<h5><code><h5></code> But that doesn't mean you should forget about them</h5>
<h6><code><h6></code> And last, but not least, the heading with the lowest rank</h6>
</article>
<article id="article">
<header id="header">
<h3><code><body> + <article> + <section> + <nav> + <aside> + <header> + <footer></code>:</h3>
</header>
<p>All these tags are already in use on the page. The list below contains links to each use case. See the source code of this file for more details.</p>
<ul>
<li><a href="#body"><code><body></code></a></li>
<li><a href="#article"><code><article></code></a></li>
<li><a href="#sections"><code><section></code></a></li>
<li><a href="#nav"><code><nav></code></a></li>
<li><a href="#aside"><code><aside></code></a></li>
<li><a href="#header"><code><header></code></a></li>
<li><a href="#footer"><code><footer></code></a></li>
</ul>
</article>
<footer id="footer">
<a href="#body">Back to top 👆</a>
</footer>
</section>
<section id="grouping-content">
<header>
<h2>Grouping content</h2>
<p>Elements: <code><p></code>, <code><address></code>, <code><hr></code>, <code><pre></code>, <code><blockquote></code>, <code><ol></code>, <code><ul></code>, <code><li></code>, <code><dl></code>, <code><dt></code>, <code><dd></code>, <code><figure></code>, <code><figcaption></code>, <code><main></code>, <code><div></code></p>
</header>
<article>
<header>
<h3><code><p></code>:</h3>
</header>
<p>Paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation, but HTML paragraphs can be any structural grouping of related content, such as images or form fields. [1]</p>
</article>
<article>
<header>
<h3><code><address></code>:</h3>
</header>
<address>
Name: Alexander Sandberg<br>
Street adress: 1 Rover street<br>
State: N/A<br>
Planet: Mars<br>
Digital home: <a href="https://alexandersandberg.com">alexandersandberg.com</a><br>
</address>
</article>
<article>
<header>
<h3><code><hr></code>:</h3>
</header>
<hr>
</article>
<article>
<header>
<h3><code><pre></code>:</h3>
</header>
<pre>Preformatted text
will be presented
exactly as written
in the HTML file.
</pre>
</article>
<article>
<header>
<h3><code><blockquote></code>:</h3>
</header>
<blockquote>
<p>The text inside this blockquote is wrapped in <code><p></code> tags. Sometimes the quote is really long, and possibly have to occupy multiple lines, but that shouldn't be a problem.</p>
</blockquote>
</article>
<article>
<header>
<h3><code><ol> + <ul> + <li></code>:</h3>
</header>
<ol>
<li>List item 1</li>
<li>List item 2
<ol>
<li>List item 1</li>
</ol>
</li>
<li>List item 3
<ul>
<li>List item 1</li>
<li>List item 2
<ul>
<li>List item 1
<ol>
<li>List item 1</li>
<li>List item 2</li>
</ol>
</li>
<li>List item 2</li>
</ul>
</li>
<li>List item 3</li>
</ul>
</li>
<li>List item 4</li>
</ol>
<ul>
<li>List item 1
<ul>
<li>List item 1
<ul>
<li>List item 1</li>
</ul>
</li>
<li>List item 2</li>
</ul>
</li>
<li>List item 2</li>
<li>List item 3
<ol>
<li>List item 1</li>
<li>List item 2</li>
</ol>
</li>
</ul>
</article>
<article>
<header>
<h3><code><dl> + <dt> + <dd></code>:</h3>
</header>
<dl>
<dt>This is a term</dt>
<dd>And this is the accompanying description, explaining the above term.</dd>
<dd>You can also have multiple descriptions (<code><dt></code>), like this one, for each term (<code><dt></code>).</dd>
<dd>And why not nest lists inside this description?
<dl>
<dt>Another term</dt>
<dd>With some description.</dd>
</dl>
<ul>
<li>List item 1</li>
</ul>
<ol>
<li>List item 1</li>
<li>List item 2</li>
</ol>
</dd>
</dl>
</article>
<article>
<header>
<h3><code><figure> + <figcaption></code>:</h3>
</header>
<p>Used with an <code><img></code>:</p>
<figure>
<img src="https://placekeanu.com/600/300" alt="Keanu Reeves looking fine">
<figcaption>Wholesome Keanu Reeves from <a href="https://placekeanu.com" target="_blank">placekeanu.com</a>.</figcaption>
</figure>
<p>Used with a <code><blockquote></code>:</p>
<figure>
<blockquote>
<p>Seek wealth, not money or status. Wealth is having assets that earn while you sleep. Money is how we transfer time and wealth. Status is your place in the social hierarchy.</p>
</blockquote>
<figcaption>
<cite>Naval Ravikant (@naval)</cite> on <a href="https://twitter.com/naval/status/1002103497725173760">Twitter</a>.
</figcaption>
</figure>
</article>
<article>
<header>
<h3><code><main></code>:</h3>
</header>
<p>See the <a href="#main">main content</a> of this page for a use case of <code><main></code>.</p>
</article>
<article>
<header>
<h3><code><div></code>:</h3>
</header>
<div>
<p>This paragraph of text is contained inside a <code><div></code>. The element really has no special meaning, other than grouping content together, and should be used as a last resort when no other element is suitable.</p>
</div>
</article>
<footer>
<a href="#body">Back to top 👆</a>
</footer>
</section>
<section id="text-level-semantics">
<header>
<h2>Text-level semantics</h2>
<p>Elements: <code><a></code>, <code><em></code>, <code><strong></code>, <code><small></code>, <code><s></code>, <code><cite></code>, <code><q></code>, <code><dfn></code>, <code><abbr></code>, <code><ruby></code>, <code><rb></code>, <code><rt></code>, <code><rtc></code>, <code><rp></code>, <code><data></code>, <code><time></code>, <code><code></code>, <code><var></code>, <code><samp></code>, <code><kbd></code>, <code><sub></code>, <code><sup></code>, <code><i></code>, <code><b></code>, <code><u></code>, <code><mark></code>, <code><bdi></code>, <code><bdo></code>, <code><span></code>, <code><br></code>, <code><wbr></code></p>
</header>
<article id="a">
<header>
<h3><code><a></code>:</h3>
</header>
<p>Here is <a href="#a">a link</a> inside a paragraph of text. Below you can find a list of links with different <code>href</code> attributes.</p>
<ul>
<li><a href="https://github.com/alexandersandberg/html5-elements-tester">Link to an external website</a></li>
<li><a href="#a">Anchor link to this element</a></li>
<li><a href="">Link with an empty <code>href</code> attribute</a></li>
<li><a>Link missing an <code>href</code> attribute</a></li>
</ul>
</article>
<article>
<header>
<h3><code><em> + <i> + <strong> + <b></code>:</h3>
</header>
<p>The <code><em></code> element represents <em>stress emphasis</em> of its contents. Meanwhile, <code><i></code> is since HTML5 used for text in an alternative voice or mood, or otherwise offset from the <i>normal prose</i>, as you may define it.</p>
<p>If you want to <b>draw attention</b> to some text, feel free to use <code><b></code>. However, if you want to mark the importance of something, <strong>you should use <code><strong></code></strong>.</p>
</article>
<article>
<header>
<h3><code><small> + <u> + <mark> + <s></code>:</h3>
</header>
<p><small>When you want your text to represent small print, use <code><small></code>.</small></p>
<p>In most cases, there's a better element than <code><u></code> to use, but it can be useful for labelling <u>msispelt</u> text. Avoid using it, however, where the text could be confused for a hyperlink.</p>
<p>You can <mark>highlight text</mark> for reference purposes with <code><mark></code>, or if the contents is <s>no longer accurate or relevant</s>, wrap it with <code><s></code>.</p>
</article>
<article>
<header>
<h3><code><abbr> + <dfn></code>:</h3>
</header>
<p>By wrapping an abbreviation like <dfn><abbr title="Cascading Style Sheets">CSS</abbr></dfn> in both <code><dfn></code> and <code><abbr></code>, we define the term. This can later be used only using <code><abbr></code>, since we already defined <abbr title="Cascading Style Sheets">CSS</abbr> once before.</p>
</article>
<article>
<header>
<h3><code><q> + <cite> + <data> + <time></code>:</h3>
</header>
<p>When citing creative work, include the reference with a <code><cite></code> element. <cite>www.w3.org</cite> explains that <q>A citation is not a quote (for which the <code><q></code> element is appropriate)</q> instead, like used here.</p>
<p>If you want to link content with a <data value="123">machine-readable</data> translation, use <code><data></code> with a <code>value</code> attribute. However, if this data is a time- or date-related, like the date <time datetime="2019-07-04">July 4</time>, you have to use <code><time></code> together with the <code>datatime</code> attribute.</p>
</article>
<article>
<header>
<h3><code><code> + <var> + <samp> + <kbd> + <sub> + <sup></code>:</h3>
</header>
<p>When sharing code-snippets, make sure to use the <code><code></code> element. This can be done both <code>display: inline;</code>, as well as block-level:</p>
<pre><code>* {
color: rebeccapurple;
background: aliceblue;
}</code></pre>
<p>Variables should be surrounded by <code><var></code>, or <var>x</var> amount of people might be confused.</p>
<p>Sample or quotes output are represented with <code><samp></code>: <samp>Your expression '1 + 1' equals 2</samp>.</p>
<p>To represent user input, like the shortcut <kbd><kbd>Cmd</kbd> + <kbd>R</kbd></kbd> on macOS, use <code><kbd></code>.</p>
<p>If you want to <sub>subscript</sub> or <sup>superscript</sup> text, use <code><sub></code> or <code><sup></code>.</p>
</article>
<article>
<header>
<h3><code><bdi> + <bdo> + <ruby> + <rb> + <rt> + <rtc> + <rp></code>:</h3>
</header>
<p>Consider using <code><bdi></code> when working with bidirectional content, like the names <bdi>Alexander</bdi> and <bdi>علي</bdi>.</p>
<p>If you need to override the bidirectional algorithm for some content and its children, use <code><bdo></code>:</p>
<p><bdo dir="rtl">Don't forget to specify the <code>dir</code> attribute!</bdo></p>
<p><bdo dir="ltr">I said, don't forget to specify the <code>dir</code> attribute!</bdo></p>
<p>Some use of <code><ruby></code> and its related elements:</p>
<ruby>
漢 <rp>(</rp><rt>Kan</rt><rp>)</rp>
字 <rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
<br>
<ruby><rb>旧<rb>金<rb>山<rt>jiù<rt>jīn<rt>shān<rtc>San Francisco</ruby>
<p>More information about the explanation and usage of these can be <a href="https://www.w3.org/TR/2017/REC-html52-20171214/single-page.html#the-ruby-element" target="_blank">read here on www.w3.org</a>.</p>
</article>
<article>
<header>
<h3><code><span> + <br> + <wbr></code>:</h3>
</header>
<p>A <code><span></code> can be used to mark up inline text for various uses, <span style="font-weight: bolder;">here to make the text bolder</span>.</p>
<p>If you have really long text you might want to insert a<br>blank line with the <code><br></code> element. You can also insert word breaking opportunities using <code><wbr></code>, to help the browser break long words like Pneumonoultramicro<wbr>scopicsilico<wbr>volcanoconiosis.
</p>
</article>
<footer>
<a href="#body">Back to top 👆</a>
</footer>
</section>
<section id="edits">
<header>
<h2>Edits</h2>
<p>Elements: <code><ins></code>, <code><del></code></p>
</header>
<article>
<header>
<h3><code><ins> + <del></code>:</h3>
</header>
<p>If you make a <del>really huge</del> mistake, you can always go back and fix it later. <ins>And don't forget to learn from your mistake.</ins></p>
<ins><p>Both <code><ins></code> and <code><del></code> can be block-level, like this.</p></ins>
<del><p>Here's a block-level paragraph removal.</p></del>
</article>
<footer>
<a href="#body">Back to top 👆</a>
</footer>
</section>
<section id="embedded-content">
<header>
<h2>Embedded content</h2>
<p>Elements: <code><picture></code>, <code><source></code>, <code><img></code>, <code><iframe></code>, <code><embed></code>, <code><object></code>, <code><param></code>, <code><video></code>, <code><audio></code>, <code><track></code>, <code><map></code>, <code><area></code>, <code><math></code>, <code><svg></code></p>
</header>
<article>
<header>
<h3><code><img> + <svg></code>:</h3>
</header>
<img src="https://placekeanu.com/600/250/g" alt="Keanu Reeves looking fine">
<svg height="250" width="510">
<polygon points="220,10 300,210 200,245 123,234" style="fill:tomato;stroke:rebeccapurple;stroke-width:5" />
This is a fallback message. If you see this, your browser does not support inline SVG.
</svg>
</article>
<article>
<header>
<h3><code><picture> + <source></code>:</h3>
</header>
<p>A different image will be shown depending on viewport size.</p>
<picture>
<source srcset="https://placekeanu.com/800/400/y" media="(min-width: 1200px)">
<img src="https://placekeanu.com/400/300" alt="Keanu Reeves looking fine">
</picture>
</article>
<article>
<header>
<h3><code><iframe></code>:</h3>
</header>
<iframe src="https://maps.google.com/maps?width=100%&height=600&hl=en&q=New%20york+(HTML5%20Elements%20Tester)&ie=UTF8&t=k&z=14&iwloc=B&output=embed"></iframe>
</article>
<article>
<header>
<h3><code><embed></code>:</h3>
</header>
<embed src="http://techslides.com/demos/samples/sample.webm" type="video/webm">
</article>
<article>
<header>
<h3><code><object> + <param></code>:</h3>
</header>
<object data="https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf" type="application/pdf">
<param name="parameter" value="example">
</object>
</article>
<article>
<header>
<h3><code><video> + <audio> + <track></code>:</h3>
</header>
<audio controls src="https://interactive-examples.mdn.mozilla.net/media/examples/t-rex-roar.mp3">
<p>This is a fallback text. If you see this, your browser does not support embedded audio.</p>
</audio>
<p>Audio is from <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio">an example on MDN</a>.</p>
<video controls width="400">
<source src="https://interactive-examples.mdn.mozilla.net/media/examples/friday.mp4" type="video/mp4">
<track default kind="captions" srclang="en" src="https://interactive-examples.mdn.mozilla.net/media/examples/friday.vtt">
<p>This is a fallback text. If you see this, your browser does not support embedded videos.</p>
</video>
<p>Video and subtitles are from <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/track">an example on MDN</a>.</p>
</article>
<article>
<header>
<h3><code><map> + <area></code>:</h3>
</header>
<p>Each side of the image below is linked to different anchors on this page. Give it a try!</p>
<map name="image-map" id="image-map">
<area shape="circle" coords="75,75,75" href="#image-map">
<area shape="circle" coords="275,75,75" href="#body">
</map>
<img usemap="#image-map" src="https://placekeanu.com/350/150/y" alt="Keanu Reeves looking fine">
</article>
<article>
<header>
<h3><code><math></code>:</h3>
</header>
<p>The quadratic formula is:<br>
<math>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mo form="prefix">-</mo> <mi>b</mi>
<mo>±</mo>
<msqrt>
<msup> <mi>b</mi> <mn>2</mn> </msup>
<mo>-</mo>
<mn>4</mn> <mo></mo> <mi>a</mi> <mo></mo> <mi>c</mi>
</msqrt>
</mrow>
<mrow>
<mn>2</mn> <mo></mo> <mi>a</mi>
</mrow>
</mfrac>
</math>
</p>
</article>
<footer>
<a href="#body">Back to top 👆</a>
</footer>
</section>
<section id="tabular-data">
<header>
<h2>Tabular data</h2>
<p>Elements: <code><table></code>, <code><caption></code>, <code><colgroup></code>, <code><col></code>, <code><tbody></code>, <code><thead></code>, <code><tfoot></code>, <code><tr></code>, <code><td></code>, <code><th></code></p>
</header>
<article>
<header>
<h3><code><table> + <caption> + <colgroup> + <col>+ <tbody> + <thead> + <tfoot> + <tr> + <td> + <th></code>:</h3>
</header>
<table>
<caption>This is the table caption</caption>
<colgroup>
<col>
<col span="2">
<col span="1">
</colgroup>
<thead>
<tr>
<th><code><thead></code></th>
<th>2nd colgroup</th>
<th>2nd colgroup</th>
<th>3rd colgroup</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row"><code><tbody></code></th>
<td colspan="2">This is a cell spanning two columns</td>
<td>Last column</td>
</tr>
</tbody>
<tfoot>
<tr>
<th scope="row"><code><tfoot></code></th>
<td>Cell 2</td>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
</tfoot>
</table>
</article>
<footer>
<a href="#body">Back to top 👆</a>
</footer>
</section>
<section id="forms">
<header>
<h2>Forms</h2>
<p>Elements: <code><form></code>, <code><label></code>, <code><input></code>, <code><button></code>, <code><select></code>, <code><datalist></code>, <code><optgroup></code>, <code><option></code>, <code><textarea></code>, <code><output></code>, <code><progress></code>, <code><meter></code>, <code><fieldset></code>, <code><legend></code></p>
</header>
<article>
<header>
<h3><code><form> + <label> + <input> + <button> + <select> + <datalist> + <optgroup> + <option> + <textarea> + <fieldset> + <legend></code>:</h3>
</header>
<form action="#forms">
<fieldset>
<legend>Welcome to the form</legend>
<p>
<label for="input-hidden">
Hidden: <input type="hidden" id="input-hidden">
</label>
</p>
<p>
<label for="input-text">
Text: <input type="text" id="input-text">
</label>
</p>
<p>
<label for="input-text-readonly">
Text (readonly): <input type="text" id="input-text-readonly" value="You can't change this" readonly>
</label>
</p>
<p>
<label for="input-text-disabled">
Text (disabled): <input type="text" id="input-text-disabled" value="This is not available" disabled>
</label>
</p>
<p>
<label for="input-search">
Search: <input type="search" id="input-search">
</label>
</p>
<p>
<label for="input-tel">
Telephone: <input type="tel" id="input-tel">
</label>
</p>
<p>
<label for="input-url">
URL: <input type="url" id="input-url">
</label>
</p>
<p>
<label for="input-email">
Email: <input type="email" id="input-email">
</label>
</p>
<p>
<label for="input-password">
Password: <input type="password" id="input-password">
</label>
</p>
<p>
<label for="input-date">
Date: <input type="date" id="input-date">
</label>
</p>
<p>
<label for="input-month">
Month: <input type="month" id="input-month">
</label>
</p>
<p>
<label for="input-week">
Week: <input type="week" id="input-week">
</label>
</p>
<p>
<label for="input-time">
Time: <input type="time" id="input-time">
</label>
</p>
<p>
<label for="input-datetime-local">
Datetime-local: <input type="datetime-local" id="input-datetime-local">
</label>
</p>
<p>
<label for="input-number">
Number: <input type="number" id="input-number">
</label>
</p>
<p>
<label for="input-range">
Range: <input type="range" id="input-range">
</label>
</p>
<p>
<label for="input-color">
Color: <input type="color" id="input-color">
</label>
</p>
<p>
<label for="input-checkbox-1">
Checkbox 1: <input type="checkbox" id="input-checkbox-1" name="checkbox">
</label>
<label for="input-checkbox-2">
Checkbox 2: <input type="checkbox" id="input-checkbox-2" name="checkbox">
</label>
<label for="input-checkbox-3">
Checkbox 3 (disabled): <input type="checkbox" id="input-checkbox-3" name="checkbox" disabled>
</label>
</p>
<p>
<label for="input-radio-1">
Radio 1: <input type="radio" id="input-radio-1" name="radio">
</label>
<label for="input-radio-2">
Radio 2: <input type="radio" id="input-radio-2" name="radio">
</label>
<label for="input-radio-3">
Radio 3 (disabled): <input type="radio" id="input-radio-3" name="radio" disabled>
</label>
</p>
<p>
<label for="select">
Select: <select name="select" id="select">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
</label>
</p>
<p>
<label for="select-size">
Select (size): <select name="select-size" id="select-size" size=5>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
<option value="5">Option 5</option>
<option value="6">Option 6</option>
<option value="7">Option 7</option>
<option value="8">Option 8</option>
</select>
</label>
</p>
<p>
<label for="select-multiple">
Select (multiple): <select name="select-multiple" id="select-multiple" multiple>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
</label>
</p>
<p>
<label for="select-optgroup">
Select with optgroup: <select name="select-optgroup" id="select-optgroup">
<optgroup label="Group 1">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
</optgroup>
<optgroup label="Group 2">
<option value="3">Option 3</option>
<option value="4">Option 4</option>
<option value="5">Option 5</option>
</optgroup>
</select>
</label>
</p>
<p>
<label for="datalist">
Datalist:
<input name="datalist" list="datalist">
<datalist id="datalist">
<option value="Option 1">
<option value="Option 2">
<option value="Option 3">
<option value="Option 4">
</datalist>
</label>
</p>
<p>
<label for="textarea">
Textarea: <textarea name="textarea" id="textarea"></textarea>
</label>
</p>
<p>
<label for="input-file">
File (single): <input type="file" id="input-file">
</label>
</p>
<p>
<label for="input-file-multiple">
File (multiple): <input type="file" id="input-file-multiple" multiple>
</label>
</p>
<p>
<label for="input-submit">
Submit: <input type="submit" id="input-submit">
</label>
</p>
<p>
<label for="input-image">
Image button: <input type="image" id="input-image" src="https://placekeanu.com/100/40">
</label>
</p>
<p>
<label for="input-reset">
Reset: <input type="reset" id="input-reset">
</label>
</p>
<p>
<label for="input-button">
Button: <input type="button" id="input-button" value="I'm an input with type=button">
</label>
</p>
<p>
<button type="button">I'm a <code><button></code></button>
</p>
</fieldset>
</form>
</article>
<article>
<header>
<h3><code><output></code>:</h3>
</header>
<form onsubmit="return false" oninput="o.value = a.valueAsNumber + b.valueAsNumber">
<fieldset>
<legend>Testing the <code><output></code> element</legend>
<input name=a type=number step=any> +
<input name=b type=number step=any> =
<output name=o for="a b"></output>
<p>Code is taken from <a href="https://www.w3.org/TR/2017/REC-html52-20171214/single-page.html#example-5b22c23a" target="_blank">this example by W3</a>.</p>
</fieldset>
</form>
</article>
<article>
<header>
<h3><code><progress> + <meter></code>:</h3>
</header>
<form action="#forms">
<fieldset>
<legend>Testing <code><progress></code> and <code><meter></code></legend>
<p>
<label for="progress">
Progress: <progress id="progress" max="100" value="64">64%</progress>
</label>
</p>
<p>
<label for="meter-2">
Meter (ok): <meter id="meter-2" max="100" low="30" high="80" optimum="50" value="50">50/100</meter>
</label>
</p>
<p>
<label for="meter-1">
Meter (warning): <meter id="meter-1" max="100" low="30" high="80" optimum="50" value="20">20/100</meter>
</label>
</p>
<p>
<label for="meter-3">
Meter (critical): <meter id="meter-3" max="100" low="60" high="70" value="90">80/100</meter>
</label>
</p>
</fieldset>
</form>
</article>
<footer>
<a href="#body">Back to top 👆</a>
</footer>
</section>
<section id="interactive-elements">
<header>
<h2>Interactive elements</h2>
<p>Elements: <code><details></code>, <code><summary></code>, <code><dialog></code></p>
</header>
<article>
<header>
<h3><code><details> + <summary></code>:</h3>
</header>
<details>
<summary>This can be expanded</summary>
<p>And by doing so, more information is revealed.</p>
</details>
</article>
<article>
<header>
<h3><code><dialog></code>:</h3>
</header>
<dialog>
<p>This text is inside a <code><dialog></code> box! It should be hidden by default, and shown to the user when given an <code>open</code> attribute.</p>
</dialog>
</article>
<footer>
<a href="#body">Back to top 👆</a>
</footer>
</section>
<section id="scripting">
<header>
<h2>Scripting</h2>
<p>Elements: <code><script></code>, <code><noscript></code>, <code><template></code>, <code><canvas></code></p>
</header>
<article>
<header>
<h3><code><script> + <noscript></code>:</h3>
</header>
<p>Dynamic scripts and data blocks are included with the <code><script></code> element.</p>
<script>
document.write('<p>This paragraph was generated with JavaScript!</p>');
</script>
<p>If scripting is disabled when loading the page, content inside <code><noscript></code> is used instead.</p>
<noscript>
<p>I see you disabled JavaScript!</p>
</noscript>
</article>
<article>
<header>
<h3><code><template></code>:</h3>
</header>
<p>Below this paragraph, there's a <code><template></code> element containing a HTML declaration, that can be used by scripts.</p>
<template>
<p>Hi! I'm a paragraph inside the <code><template></code> element.</p>
</template>
</article>
<article>
<header>
<h3><code><canvas></code>:</h3>
</header>
<p>A <code><script></code> is used to draw a rectangle in the <code><canvas></code> below.</p>
<canvas id="canvas">
Alternative text explaining what's on display in this <canvas>.
</canvas>
<script>
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'tomato';
ctx.fillRect(10, 10, 100, 100);
</script>
</article>
<footer>
<a href="#body">Back to top 👆</a>
</footer>
</section>
</main>
<aside id="aside">
<h2>About this project</h2>
<p>A test page containing most of the HTML5 elements that you'll ever need. Useful for testing CSS resets or CSS frameworks.</p>
<p>This section is inside an <code><aside></code> element.</p>
</aside>
<footer>
<p><a href="https://github.com/alexandersandberg/html5-elements-tester">HTML5 elements tester</a> by <a href="https://alexandersandberg.com">Alexander Sandberg</a> · <a href="#body">Back to top 👆</a></p>
</footer>
</body>
</html>