數倍的元素我有這個簡單的代碼:獲取該ID的jQuery的
$('[id^=pz]').change(function() {
//Getting the numbers after the letters "pz":
//1
//2
//100
});
<input type="text" id="pz1">
<input type="text" id="pz2">
<input type="text" id="pz100">
如何檢索每個元素的數量?
謝謝。
'VAR NUM = this.id.substr(2);'! –
非常感謝你@ibrahim mahrir – eawedat