我嘗試爲輸入'pid'屬性設置新值並獲取此值,但我得到null
。如何獲得輸入新的屬性值
我有這樣的代碼jQuery中:
$(".feauter-product-holder").click(function() {
$("#productsubject").attr("pid", $(this).find("input[type=hidden]").attr("id"));
});
和我的代碼在HTML:
<div class='feauter-product-holder'>
<input type="hidden" id="3">
</div>
<asp:TextBox runat="server" ID="productsubject" pid=""></asp:TextBox></div>
$.ajax({
url: editor.config.saveSubmitURL,//the url to post at... configured in config.js
type: 'POST',
data: { servicename: "savedata", text: data, subject: $("#productsubject").val(), pid: $("input[id$='productsubject").attr("pid") },//editor.name contains the id of the current editable html tag
})
我編輯這個職位 我寫錯誤的類股利,但在我的代碼是正確的。 當我打電話給阿賈克斯pid我得到空
我該怎麼辦?
'類='feauter - 產品 - holder'' – rps
我已經更新了我的帖子 – user3243749