本文實例講述了jQuery+php實時獲取及響應文本框輸入內容的方法。分享給大家供大家參考,具體如下:
該程序能夠查出可用余額:
HTML部分:
<input type="text" name="username" id="username" onkeyup="search_func(this.value);" /><em id="mfee"></em>
jquery部分:
function search_func(value){ $.post("/xxx.php", { q: "action/cash_news", username:value},function (result){ var r = "可用金額"+result+"元"; $("#mfee").html(r); $("#moneyss").val(result); });}
更多關于jQuery相關內容感興趣的讀者可查看本站專題:《jquery中Ajax用法總結》、《jQuery表格(table)操作技巧匯總》、《jQuery拖拽特效與技巧總結》、《jQuery擴展技巧總結》、《jQuery常見經典特效匯總》、《jQuery動畫與特效用法總結》、《jquery選擇器用法總結》及《jQuery常用插件及用法總結》
希望本文所述對大家jQuery程序設計有所幫助。
新聞熱點
疑難解答