.addClass()復制出去怎么不運行
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
? ? <head>
? ? ? ? <meta charset="utf-8">
? ? ? ? <title>:text表單選擇器</title>
? ? ? ? <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
? ? ? ? <link href="style.css" rel="stylesheet" type="text/css" />
? ? </head>
? ??
? ? <body>
? ? ? ? <h3>修改多個單行輸入框元素的背景色</h3>
? ? ? ? <form id="frmTest" action="#">
? ? ? ? <input type="text" id="Text1" value="我是小紙條"/><br />
? ? ? ? <textarea rows="3" cols="8"></textarea><br />
? ? ? ? <input type="text" id="Text2" value="我也是小紙條"/><br />
? ? ? ? <button>
? ? ? ? ? ? Button</button><br />
? ? ? ? </form>
? ? ? ??
? ? ? ? <script type="text/javascript">
? ? ? ? ? ? $("#frmTest:text").addClass("red");
? ? ? ? </script>
? ? </body>
</html>
2016-06-07
你得把樣式表一同復制出去才能起效果啊;
或者把樣式寫到頁面里面去
2016-06-03
.addClass("這里面是一個css樣式,例如bg_blue其實是
.bg_blue
{
? ? background-color: blue;
? ? color:Orange;
}
你應該是沒有注意到還有一個
")
2016-05-25
你運行有效果?我加了空格還是不行
2016-05-25
中間少了空格, :text 前面要有空格