HTML 中
onkeyup="stripscript(this)";
function stripscript(obj) {
var s = $(obj).val();
var pattern = new RegExp("[`[email protected]#$^&|\\<>/[email protected]#¥&]")
var rs = "";
for (var i = 0; i < s.length; i++) {
rs = rs + s.substr(i, 1).replace(pattern, ‘‘);
}
$(obj).val(rs);
}
时间: 2024-10-21 05:54:29