如何区分我的身份证?我想在不同的功能中使用我的div。第一个ID在函数中使用,另一个ID在脚本中使用
<div class="g2 ">
<input type="text" id="noPosting number_only" disabled="true" name="post_every" value="" class="txt_r integer-365"/>
</div>
function disableNeverPosting(v) {
if (v.value == 'no_posting') {
noPosting.disabled = true;
}
else {
noPosting.disabled = false;
}
}
$("input[id='number_only']").keydown(function (e) {
// Allow: backspace, delete, tab, escape, enter , F5
if ($.inArray(e.keyCode, [46,8, 9, 27, 13, 110,116]) !== -1 ||
// Allow: Ctrl+A, Command+A
(e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
// Allow: home, end, left, right, down, up
(e.keyCode >= 35 && e.keyCode <= 40)) {
// let it happen, don't do anything
return;
}
// Ensure that it is a number and stop the keypress
if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
e.preventDefault();
}
});