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
Post a Comment