工作,我有一个表:的document.getElementById不在JS
<tr>
<td><input type="text" name="remaining_quantity" id="remaining_quantity" value="<?php if(isset($quantity)) echo $quantity; ?>"/></td>
<td><input type="text" name="remaining_price" id="remaining_price" value="<?php if(isset($price)) echo $price; ?>" /></td>
<input type="button" class="check fr ml" value="Check" id="check_equation" onclick="get_full_status()" />
</tr>
我想找到的值输入字段,因此,
function get_full_status(){
var remaining_quantity = document.getElementById('remaining_quantity').value;
var remaining_price = document.getElementById('remaining_price').value;
alert(remaining_quantity);alert(remaining_price);
}
我没有得到实际值。如果你不明白问题,请问我。
在控制台中是否有任何错误?警报返回值是什么? – Pierfrancesco
控制台中没有错误。它警报空白。 – yank
您是否检查过'value'属性? *它有任何价值吗? – haim770