Disabling Individual input Elements

Description

You can disable input elements so that the user cannot enter data into them.

Example

The following code uses the disabled Attribute on input Elements.


<!DOCTYPE HTML>
<html>
<body>
  <form method="post" action="http://example.com/form">
    <p>
      <label for="fave">Fruit: <input autofocus id="fave"
        name="fave" /></label>
    </p><!-- w w w. ja  v a 2  s .  c o  m-->
    <p>
      <label for="name">Name: <input disabled id="name" name="name" /></label>
    </p>
    <button>Submit Vote</button>
  </form>
</body>
</html>

Click to view the demo





















Home »
  HTML CSS »
    HTML »




HTML Introduction
HTML Document
HTML Section
HTML Group Content
HTML Text Marker
HTML Table
HTML Form
HTML Embed