Exampler.org SAS PYTHON HTML
HTML Home
HTML Table
HTML Form
HTML Button
HTML Checkbox
HTML Select
HTML Contact Form

HTML Select Input;

What is it?

Syntax:

  • Select: <Select name='pokemon' id='pokemon_select' >
  • Option: <Option value='Charizard'> Charizard </option>
  • Option: <Option value='Mewtwo'> Mewtwo</option>
  • Option: <Option value='Blastoise'> blastoise </option>
  • Option: <Option value='Venusaur'> Venusaur </option>
  • Option: <Option value='Arceus'> Arceus </option>
  • Option: <Option value='Raquaza'> Raquaza </option>
  • Select: </Select>


 Basic Checkbox Example :



<form action='transmitmydata.php' method='post' >

     Red <input type='checkbox' id='red' name='color' checked>
     Blue <input type='checkbox' id='blue' name='color' checked>
     Green <input type='checkbox' id='green' name='color' checked>
     <input type='button' value='Submit'>

</form>





What's happening in the script above?

  • The above form has 3 checkboxes and 1 submit button
  • Each checkbox has their own id value which is really useful when using JavaScript. JavaScript will allow you access each checkbox using the following command.
  • <script> x = document.getElementById("red").value <script>
  • Also in this example, all the checkboxes are by default "checked" you could just as easily remove that word, and the checkboxes will default to empty.


Example Output:

Red Blue Green






See also; HTML Form

See also; HTML Buttons

See also; HTML Table




Connect via LinkedIn

Kevin Regan

Have an article, idea, found a typo, want to contribute? Shoot me an email Here