Disable input elements so that the user cannot enter data. - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:input

Introduction

You disable input elements by applying the disabled attribute.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
   <head> 
      <title>Example</title> 
   </head> 
   <body> 
      <form method="post" action="http://example.com/form"> 
         <p> 
            <label for="fave">
               Fruit: <!--from w  ww . j a  va2 s.co m-->
               <input autofocus id="fave" name="fave">
            </label> 
         </p> 
         <p> 
            <label for="name">
               Name: 
               <input disabled id="name" name="name">
            </label> 
         </p> 
         <button>Submit Vote</button> 
      </form>  
   </body>
</html>

Related Tutorials