Buttons (button), online
Six activities your students do on their own devices. See who's finished, and their scores.
Buttons (button) in one minute
What students need to know
The button here has no type, so it defaults to submit - clicking it will send the form. Always specify type to be safe. HTML tag names must be lowercase. <BUTTON> is non-standard - use <button>.
type="button" creates a button that does nothing by default. It is typically used with JavaScript event handlers. 'none' is not a valid type value. All attribute values must be in double quotes. type=submit without quotes is invalid HTML.
Mistakes students make
- HTML tag names must be lowercase. <BUTTON> and </BUTTON> should be <button> and </button>.
- The type attribute value must be in double quotes: type="submit", not type=submit without quotes.
- 'submitt' is a typo. The correct value is type="submit" (one t).
- The button closing tag is missing its > angle bracket. Write: <button>Search</button>.
What students will learn in this module
Every question in Module 30
Quick questions
- What does type="submit" do on a button?AClears all form fieldsBSends the form data when clicked
- What does type="reset" do on a button?AResets all form fields to their default valuesBSubmits the form
- True or false: a <button> inside a form defaults to type="submit" if no type is specified.ATrueBFalse
- True or false: <BUTTON> with capital letters is valid HTML.AFalseBTrue
- Which type value creates a button that performs no default form action?AnoneBbutton
Key terms
Students type the meaning of:
<button>
Match the pairs
<button type="submit">Login</button>Match it to what it does<button type="reset">Clear</button>Match it to what it doesA <button> without a type defaults to type="submit" inside a formMatch it to what it doestype="button" creates a button with no default action - used with JavaScriptMatch it to what it does<BUTTON type="submit">Send</BUTTON>Match it to what it does<button type=submit>Send</button>Match it to what it doesFill in the blanks
<______ type="submit">Send</button>
Hint: Type the element name that creates a clickable button
<button type="______">Submit</button>
Hint: Type the type value that makes a button submit its form
<button type="_____">Clear</button>
Hint: Type the type value that resets all form fields to their default values
<button type="button">Go</______)
Hint: Type the element name for the closing tag of a button
<form> <______ type="submit">Send</button> </form>
Hint: Type the element name used to create a clickable form button
Spot the error
Question 1
A<BUTTON type="submit">Send</BUTTON>B<input type="text" name="q">C<button>Cancel</button>
Question 2
A<form>B <button type=submit>Send</button>C <button type="reset">Clear</button>D</form>
Question 3
A<form>B <input type="text" name="q">C <button type="submitt">Go</button>D</form>
Question 4
A<form>B <input type="text" name="q">C <input type="email" name="e">D <button>Search</buttonE</form>
Question 5
A<form>B <input type="text" name="a">C <input type="text" name="b">D <input type="text" name="c">E <Button type="submit">Send</Button>F</form>
