![](/img/trans.png)
[英]using jquery autocomplete i am trying to get the value in the text box as table the datas are not coming from json using ajax in the text field
[英]i am trying to get value of particular hidden input text box using jquery it's not working
我插入此之前嘗試過
var req=$('#'+investor_id+'#requestId');
var requestId=document.getElementById(req).value;
alert(requestId);)
代碼它工作正常但在它不工作之后, 這里是代碼
為什么不使用id訪問元素而不是寫入pipings。 ID值在文檔中是唯一的。
試試這個代碼
alert($('#requestId').val());
//Check here for working demo http://jsfiddle.net/9fTPh/6/
代替
var req=$('#'+investor_id+'#requestId');
var requestId=document.getElementById(req).value;
alert(requestId);
並且在你提供代碼的小提琴中},)沒有正確給出。(用JsLint檢查)
您應該稍微更改一下代碼: http : //jsfiddle.net/rkw79/9fTPh/17/
這個小提琴稍微清理了你的代碼,但你通常應該采取這個步驟:
1)點擊'tidyup'按鈕,然后找失蹤});
2)如果它們不是唯一的,請不要使用id,只需使用class
3)你不必為了找到它而在所有東西上設置id,所有對象都是相對的
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.