jsp
<div class="row" style="display:none" id="amount">
<EF:EFInput ename="result-0-rewardAmount" cname="奖励金额" required="true" ratio="3:9" maxLength="32"
></EF:EFInput>
</div>
js
$("#result-0-securityType").on("change", function (e) {
console.log($("#result-0-securityType").val());
var securityType=$("#result-0-securityType").val();
if (securityType=='10') {
$("#amount").show();
}
else {
$("#amount").hide();
}
});
注意:这里之所以把style="display:none"写在div中,是因为写在input里面只能控制输入框隐藏,而不能控制输入框标题隐藏;
1、input框的type="hidden"属性对hide()和show()方法不管用;
2、hidden=“hidden”和style="display:none"属性对hide()和show()方法可用;