$("#txtcode").autocomplete({
minLength: 1,
source: "/AC/student.php?searchMode=''&Stno="+$("#txtcode").attr("value"),
select: function(event, ui)
{
var label= ui.item.label;
var value= ui.item.value;
var stuArr = label.split('-');
alert(stuArr [1]);
$('#tx_stname').val(stuArr [1].replace(/\$/g, ""));
}
});
在上面的代碼中,當我說alert(stuArr [1]);
。如何去掉字體Jquery中的標籤
我從服務器端腳本獲取font
標記<font size='1' color='green'>ABCDERT(Student name)</font>
。
如何刪除font
標籤並在文本框中輸入「ABCDERT」名稱($('#tx_stname')
)?
@nick:蔭抽到,我期待但在文本框中的值仍然conatains的 '$$' 的價值someValue中'',我用這個語句替換(stuArr [1] .replace(/ \ $/g,「」));。我如何替換文本字段$''中的'$$'SOME值''('#tx_stname ').val($(stuArr [1])。text.replace(/ \ $/g,「」));這是返回錯誤 – Someone 2010-08-23 16:11:00
@Someone - 你需要在該調用中的'.text()',然後你所有設置的括號:) – 2010-08-23 16:16:26
謝謝它解決了。但我該如何取代'有價值'。我該如何取代「某些價值」的單引號 – Someone 2010-08-23 16:20:38