javascript - jQuery remove spaces on blur not working -


the replace function i'm using works i've tested in console not work @ on blur. how can fix that?

<script type="text/javascript">     //ensure spaces not entered between tags     jquery(document).ready(function(){         jquery('#item_keywords').blur(function(){             $(this).val().replace(/^\s+$/,"");         });     }); </script> 

you have removed spaces u have not assigned them :)

jquery(document).ready(function(){         jquery('#item_keywords').unbind('blur').bind('blur',function(){             $(this).val($(this).val().replace(/^\s+$/,""));         });     }); 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -