我有一個通用的函數來獲取數據,並禁用另一個HTML標籤:使用內容變量作爲HTML標籤
function Testing(htmlData, htmlResult) {
//here I'd like get the value of htmldata (it's a tag name)
}
我調用這個函數是這樣的:
<input type="text" id="MyTextBox" />
<input type="text" id="MyTextBoxResult" />
$("#MyTextBox").blur(function() {
Testing("MyTextBox", "MyTextBoxResult");
});
您在評論中說您使用標記名稱稱爲'測試',但在標記ID爲'MyTextBox'後調用它。那麼你真的想要什麼? –
$(「#」+ htmlData).val()? –