469,307 Members | 2,023 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,307 developers. It's quick & easy.

Javascript: changing how some part of an input text is displayed

Hi forum,

In an input type=text, I would like to display the first ten characters being entered in bold, and the next one with the default style.

Is it possible to do this using Javascript, and how.

Thank you for your help,

Feb 1 '08 #1
2 921
428 256MB
You need separate inputs, one class or set of style properties for each.

You can use css to make them appear to be one element, by containing them in a span styled to look like an input, and removing their borders.

javascript can move the focus to the next field by checking the length of the first field on keydown.
Feb 1 '08 #2
Thank you for your great tip.
Feb 5 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

By using this site, you agree to our Privacy Policy and Terms of Use.