24.08.2016 Views

HTML and CSS design and build websites

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Checkbox Article<br />

<strong>HTML</strong><br />

chapter-07/checkbox.html<br />

<br />

Please select your favorite music service(s):<br />

<br />

iTunes<br />

Last.fm<br />

Spotify<br />

<br />

<br />

Result<br />

<br />

type="checkbox"<br />

Checkboxes allow users to select<br />

(<strong>and</strong> unselect) one or more<br />

options in answer to a question.<br />

name<br />

The name attribute is sent to<br />

the server with the value of the<br />

option(s) the user selects. When<br />

a question provides users with<br />

options for answers in the form<br />

of checkboxes, the value of the<br />

name attribute should be the<br />

same for all of the buttons that<br />

answer that question.<br />

value<br />

The value attribute indicates<br />

the value sent to the server if this<br />

checkbox is checked.<br />

checked<br />

The checked attribute indicates<br />

that this box should be checked<br />

when the page loads. If used, its<br />

value should be checked.<br />

FORMS<br />

156

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!