Home > Web Front-end > JS Tutorial > body text

How to remove the spaces before and after the input box in jquery?

零下一度
Release: 2017-06-26 14:46:56
Original
2599 people have browsed it

1.

2.

<script type="text/javascript">$(document).ready(function() {
     $('#searchform input').keyup(trimkeyup);
 }); function trimkeyup(e) {
    lucene_objInput = $(this);     if(e.keyCode != 38 && e.keyCode != 40 && e.keyCode != 13) {       var im = $.trim(lucene_objInput.val());
       lucene_objInput.val(im); 
    }
}  
</script>
Copy after login

 

The above is the detailed content of How to remove the spaces before and after the input box in jquery?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template