<input type="checkbox" id="1" name="suffix[]" checked /><br/>
<div id="div_h" >0-max</div>
<input type="text" id="aa" name="price[]" value="+++" style="width:20;display:none;" /><input type="text" id="bb" name="price[]" value="---" style="width:20;display:none;" />
<script type="text/javascript">
window.onload = function(){
document.getElementById("1").onclick = function(){
var txt1 = document.getElementById("aa");
var txt2 = document.getElementById("div_h");
var txt3 = document.getElementById("bb");
var txt4 = document.getElementById("div_h1");
if(this.checked){
txt1.style.display ="none";
// txt1.setAttribute("name","changeName");
txt2.style.display = "block";
txt3.style.display ="none";
txt4.style.display ="none";
}
else{
txt1.style.display = "block";
txt3.style.display = "block";
checkbox隐藏文本框示例
最新推荐文章于 2021-07-20 09:16:37 发布