久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      jquery怎么修改hidden屬性

      方法:1、用attr(),語(yǔ)法“元素對(duì)象.attr("hidden",值)”;2、用prop(),語(yǔ)法“元素對(duì)象.prop("hidden",值)”;3、用removeAttr(),語(yǔ)法“元素.removeAttr("hidden")”。

      jquery怎么修改hidden屬性

      本教程操作環(huán)境:windows7系統(tǒng)、jquery1.10.2版本、Dell G3電腦。

      hidden 屬性規(guī)定對(duì)元素進(jìn)行隱藏。隱藏的元素不會(huì)被顯示。如果使用該屬性,則會(huì)隱藏元素。

      jquery修改hidden屬性

      1、使用attr()屬性設(shè)置hidden屬性的值

      <!DOCTYPE html> <html> 	<head> 		<meta charset="utf-8" /> 		<script src="js/jquery-1.10.2.min.js"></script> 		<script> 			$(document).ready(function() { 				$("button").click(function(){ 					$("div").attr("hidden",false); 				}); 			}); 		</script> 	</head> 	<body> 		<p>測(cè)試文字-p元素</p> 		<div hidden>測(cè)試文字-div元素</div> 		<p>測(cè)試文字-p元素</p> 		<button>修改hidden屬性 </button> 	</body> </html>

      jquery怎么修改hidden屬性

      2、用prop()屬性設(shè)置hidden屬性的值

      <!DOCTYPE html> <html> 	<head> 		<meta charset="utf-8" /> 		<script src="js/jquery-1.10.2.min.js"></script> 		<script> 			$(document).ready(function() { 				$("button").click(function(){ 					$("div").prop("hidden",false); 				}); 			}); 		</script> 	</head> 	<body> 		<p>測(cè)試文字-p元素</p> 		<div hidden>測(cè)試文字-div元素</div> 		<p>測(cè)試文字-p元素</p> 		<button>修改hidden屬性 </button> 	</body> </html>

      運(yùn)行效果和方法1一樣

      3、用removeAttr()屬性刪除hidden屬性

      <!DOCTYPE html> <html> 	<head> 		<meta charset="utf-8" /> 		<script src="js/jquery-1.10.2.min.js"></script> 		<script> 			$(document).ready(function() { 				$("button").click(function(){ 					$("div").removeAttr("hidden"); 				}); 			}); 		</script> 	</head> 	<body> 		<p>測(cè)試文字-p元素</p> 		<div hidden>測(cè)試文字-div元素</div> 		<p>測(cè)試文字-p元素</p> 		<button>修改hidden屬性 </button> 	</body> </html>

      運(yùn)行效果和方法1一樣

      【推薦學(xué)習(xí):jQuery視頻教程、web前端視頻】

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)