Skip to content

Instantly share code, notes, and snippets.

@fuzzbomb
Created July 18, 2018 20:46
Show Gist options
  • Save fuzzbomb/cde8dcceb17781281ae496c69d10195f to your computer and use it in GitHub Desktop.
Save fuzzbomb/cde8dcceb17781281ae496c69d10195f to your computer and use it in GitHub Desktop.
Fieldset-legend validation demo
<!DOCTYPE html>
<html lang="en">
<head>
<title>HTML5 Fieldset/Legend demo</title>
<meta charset="utf-8">
</head>
<body>
<h1>HTML5 Fieldset/Legend demo</h1>
<p>THis page has a form with fieldsets. One fieldset has a legend, the other doesn't. What does the HTML validator say?</p>
<form action="/example">
<fieldset>
<p>This fieldset doesn't have a legend.</p>
<label for="most-fav-color">Most Favourite Colour</label>
<input type="text" id="most-fav-color">
<label for="least-fav-color">Least Favourite Colour</label>
<input type="text" id="least-fav-color">
</fieldset>
<fieldset>
<legend>Food</legend>
<p>This fieldset has a legend.</p>
<label for="most-fav-food">Most Favourite Food</label>
<input type="text" id="most-fav-food">
<label for="least-fav-food">Least Favourite Food</label>
<input type="text" id="least-fav-food">
</fieldset>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment