Mega Code Archive

 
Categories / JavaScript Tutorial / Form
 

Checkbox value

Syntax document.form.checkbox.value The value property provides access to value attribute of the check box. This property is a read/write value that is sent to the server when the form is submitted. <html>     <form name="orderForm">       <input type="checkbox"              name="onion"              value="hot onion">Onion<br>       <input type="checkbox"              name="bacon"              value="spicy bacon">Bacon<hr>       <input type="button"              value="Order Pizza"              name="orderButton"              onClick="alert('ordered.')">     </form>     <script language="JavaScript">     <!--     document.write(document.orderForm.onion.value);        document.write(" or ",document.orderForm.bacon.value);       -->     </script>     </html>