简体   繁体   中英

Set letter spacing of last character in input field

I'm currently creating an input field that requires letter spacing, but if the last letter is spaced it shifts everything out of alignment... I was just wonder if there would be anyway of finding the last character of the input field which will be the 13th character with jquery or JavaScript and setting the letter spacing to 0.

Any help appreciated.

Check out Lettering.js . It wraps characters in HTML, allowing you to manipulate them more finely with CSS.

If I understand you correctly, you are trying to trim the trailing space right??

If so you can simply trim the input field value every time it changes. Here is the JQuery solution.

$.trim(MyInput.value);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM