我正在使用的替换功能在控制台中进行了测试,但它在模糊时根本不起作用。我该如何解决?
<script type="text/javascript">
//Ensure spaces are not entered between tags
jQuery(document).ready(function(){
jQuery('#item_keywords').blur(function(){
$(this).val().replace(/^\s+$/,"");
});
});
</script>