我有一個簡單的功能,看起來像這樣jQuery的解析HTML
var getCellText = function ($cell) {
var html = $cell.html();
$(html).find("input").each(function() {
alert(this.value);
});
}
的HTML可能看起來像這樣
<input class="lineno" name="lineno" value="4109375" type="hidden">
<input onchange="Time.UpdateLine(this, 'studentno', this.value, '4109375');" class="studentno" value="2088" type="text">
我需要得到studentno輸入變量的值(我可以忽略名爲lineno的輸入)。
我怎麼能做到這一點,你可以看到,我已經給了它一個嘗試
+1使用.find () –
感謝您的幫助 – The87Boy