欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

jQuery使用CSS()方法給指定元素同時設(shè)置多個樣式

 更新時間:2015年03月26日 08:53:46   作者:上大王  
這篇文章主要介紹了jQuery使用CSS()方法給指定元素同時設(shè)置多個樣式的方法,實例分析了jQuery中css方法的使用技巧,非常具有實用價值,需要的朋友可以參考下

本文實例講述了jQuery使用CSS()方法給指定元素同時設(shè)置多個樣式的方法。分享給大家供大家參考。具體如下:

<!DOCTYPE html>
<html>
<head>
<script src="js/jquery.min.js">
</script>
<script>
$(document).ready(function(){
 $("button").click(function(){
  $("p").css({"background-color":"blue","font-size":"14px"});
 });
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p style="background-color:#ff0000">This is a paragraph.</p>
<p style="background-color:#00ff00">This is a paragraph.</p>
<p style="background-color:#0000ff">This is a paragraph.</p>
<p>This is a paragraph.</p>
<button>Set multiple styles for p</button>
</body>
</html>

希望本文所述對大家的jQuery程序設(shè)計有所幫助。

相關(guān)文章

最新評論