Trigger an event after selecting an option in the select tag in js

<!DOCTYPE html>
<html>
<body>

<h1>My First Web Page</h1>

<p id="demo">My First Paragraph.</p>

<script>
document.getElementById("demo").innerHTML="My1 First JavaScript";
</script>
<se>
<script type="text/javascript">
function checkLawyerType() {
                var lawyerType1 = document.getElementById("lawyerType").innerHTML;
		var lawyerType = document.getElementById("lawyerType").value;
			
			var account = document.getElementById("account")
                        alert(lawyerType1);
			if(lawyerType=="1"){
				account.readOnly = false ;
			}else{
				account.readOnly =true ;
			}
			
		};
</script>

<select id="lawyerType" htmlEscape="false" maxlength="30"  minlength="1"  class="form-control required" onchange = "checkLawyerType();">
  <option value ="0"></option>
  <option value ="1">执行</option>
  <option value="2">仲裁</option>
</select>
<input name ="account" id ="account" readOnly="true">
</body>
</html>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325894367&siteId=291194637