Label content
<div class= "box" >
Please write JavaScript code to complete the following function requirements: <br/>
1. After the cancellation of the check, the promotion price, promotion start end Date 3 controls are not available. <br/>
2. When the check box is selected, 3 controls are available for the promotion price, promotion start end date.
</div>
<div class= "box" >
<table id= "table1" class= "MyTable" >
<tr>
<td> whether to promote:</td>
<td><input type= "checkbox" id= "Chkpromote"/></td>
</tr>
<tr>
<td>
Promotion Price:
</td>
<td>
<input type= "text" id= "Txtpromoteprice"/>
</td>
</tr>
<tr>
<td>
Promotion Date:
</td>
<td>
<input type= "text" id= "Txtstart"/>-
<input type= "text" id= "Txtend"/>
</td>
</tr>
</table>
</div>
jquery content
<script>
$ (function () {
$ ("Input[type=text]"). attr ("Disabled", true). Val ("Not Available");
$ ("Input[type=checkbox]"). Click (function () {
var $CR = $ ("Input[type=checkbox]");
if ($CR. Is (": Checked")) {
$ ("Input[type=text]"). attr ("disabled", false). val ("can be used");
}
else {
$ ("Input[type=text]"). attr ("Disabled", true). Val ("Not Available");
}
});
});
</script>
jquery check box checked suppress display hide for text box