如何清除input中的内容
清空input中的内容,在iOS可以清除,在安卓不能
<div class="add_address_person rel fix">
<input name="" type="text" class="person_address_input" id="linkMan" placeholder="联系人不能超过10个字" value="${address.linkMan}" maxlength="10" />
<em class="my_address_person">联系人:</em>
<div class="clear-add"></div>
</div>
<div class="add_address_person rel fix">
<input name="" type="number" class="person_address_input" id="linkPhone" placeholder="请输入您的联系电话" value="${address.linkPhone}" />
<em class="my_address_person">联系电话:</em>
<div class="clear-add"></div>
</div>
});
// 清除input中的val值
$(".person_address_input").focus(function() {
$(this).siblings(".clear-add").show();
$(".clear-add").click(function() {
var clear_num = $(this).siblings(".person_address_input").val();
clear_num = 0;
var clear_num1 = $(this).siblings(".person_address_input").val("");
$(".clear-add").hide();
});
});
$(".person_address_input").blur(function() {
$(this).siblings(".clear-add").hide();
})
2 个回复
lopo1983
赞同来自:
catchcat - - 怨只怨人在风中
赞同来自: