jquery Simple code to make form elements unavailable

  • 2021-07-02 22:53:42
  • OfStack

This section shows you how to set a form element to an unavailable state in 1 with simple example code.

The code example is as follows:

<!DOCTYPE html> 
<meta charset=" utf-8"> 
<meta name="author" content="https://www.ofstack.com/" /> 
<title> Script House </title> 
<script type="text/javascript" src="mytest/jQuery/jquery-1.8.3.js"></script> 
<script type="text/javascript"> 
 Website name :<input type="text" id="webname"/><br/> 
 Script House <input type="button" value=" View effect " id="bt"/> 

The above code sets the disabled attribute of the form element through the prop () function.

Related articles: