HTML Input Attributes — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the HTML Input Attributes lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Add a placeholder
easy10 minAdd placeholder text to an input.
- 2
Make a field required
easy10 minMark the input as required.
- 3
Set a default value
easy10 minGive the input a default value of 1.
- 4
Make a field read-only
easy10 minMark the input as readonly.
- 5
Limit the length
medium10 minRestrict the input to 10 characters.
Find the bug(5)
- 1
Fix the placeholder used as a label
easy8 minA placeholder disappears on typing — add a real label.
- 2
Fix the misspelled required
easy8 min"require" is not a valid attribute.
- 3
Fix the default set as text
easy8 minDefault content goes in the value attribute, not between tags.
- 4
Fix disabled used instead of readonly
easy8 minA disabled field is not submitted; readonly is.
- 5
Fix the wrong length attribute
easy8 minThe attribute is maxlength, not maxsize.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace