我如何从文本框ID中恢复到PID?

时间:2016-07-24 13:31:30

标签: jquery html

这部分是jQuery

var PId = ''; //Here I declare the PID
var objA = new A();
objA.AID = AID;
objA.PId = PId;  
$('div[data-id="divDetailPopupControl"] div[data-id="accordion"]').find('div[data-type="txtPropertyId"]').attr('data-type', 'txtPId' + i).html();
$('div[data-id="divDetailPopupControl"] div[data-id="accordion"]').find('div[data-type="txtPId' + i + '"]').attr('PId' + i, item.PId).html();
//Here I console .log to check the result whether work or not. but now still not working.. 
console.log($('div[data-id="divDetailPopupControl"] div[data-id="accordion"]').find('div[data-type="txtPId' + i + '"]')); 

此部分为HTML

 <div data-id="Detail">
   <div id="ItemDetails" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
     <div class="panel-body">
       <div style="margin: 2px; background-color: white; padding: 10px; max-height: 500px; overflow:auto;">
         <div class="spacer-custom"></div>
         <div data-type="txtPId" display="hidden"></div>
          <div class="form-inline" role="form">
            <div class="form-group col-xs-2 left">
               <label class="control-label body-blue">Title No: </label>
            </div>
                 <div class="col-xs-3">
                   <div data-type="txtTitleNumber"></div>
                 </div>

这是我在隐藏文本框中显示ID的输出。 https://gyazo.com/0f53616f8f268ccdd74aee76d9a040ff

你好,伙计们,  1.如何从文本框中取回PID?  2.使用item.PID我可以得到实际结果。 谢谢。

0 个答案:

没有答案