我如何一次清除(即设置为“”)所有输入值?
<div id="hidden-inputs">
<input type="hidden" value="9013 NE Hwy 99" id="adderss_copy" name="adderss_copy">
<input type="hidden" value="Vancouver" id="city_copy" name="city_copy">
<input type="hidden" value="WA" id="states_id_copy" name="states_id_copy">
<input type="hidden" value="98665" id="zipcode" name="zipcode">
<input type="hidden" value="Clark County" id="county" name="county">
<input type="hidden" value="US" id="country" name="country">
<input type="hidden" value="45.687949" id="latitude" name="latitude">
<input type="hidden" value="-122.659134" id="longitude" name="longitude">
<input type="hidden" value="" id="timezone" name="timezone">
</div>
我未能成功尝试以下内容:
$('#hidden-inputs').find(':input').val('');
$('#hidden-inputs :input').val('');
答案 0 :(得分:2)
尝试
$('#hidden-inputs input').val('');
答案 1 :(得分:0)