-2
如何使用jQuery的關鍵字包含文本框,我重視的小提琴鏈接,你的代碼參考,使用jQuery包含用於文本框
<div id="txtCon">
<input type="text" name="man-news" />
<input type="text" name="milkman" />
<input type="text" name="letterman2" />
<input type="text" name="newmilk" />
has
</div>
Script:
$('input[name*="new"]').val('has');
$('input:text:contains("has")').css("color","red");
鏈接:
http://jsfiddle.net/vigneshjayaraman/Ytsr5/2/
我想你理解錯了包含選擇,請看看這個: http://www.w3schools.com/jquery/jquery_ref_selectors.asp – 2013-05-02 04:13:27
可能複製[這裏](http://stackoverflow.com/questions/4939071/jquery-val-contains)
看看那裏! – MISJHA 2013-05-02 04:14:13