Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有什么方法可以删除输入字段中一组前 3 个字符的匹配项,一旦用户完成输入,使用 jQuery?
如果您想在用户将光标移动到其他字段后删除前三个字符,请使用此代码...
$('#yourInputField').blur(function(event) { field = event.target; value = field.value; $('#yourInputField').val(value.substring(3,value.length)); });