How do you replace content without losing focus?

Posted by Ryan on Stack Overflow See other posts from Stack Overflow or by Ryan
Published on 2010-04-29T19:11:24Z Indexed on 2010/04/29 19:17 UTC
Read the original article Hit count: 221

Filed under:

For example:

<input type="text" name="test" onChange="document.formname.test.value=.document.formname.test.value.replace('something','something else')" />

The replace function works but it loses focus on every change

How do you make it not lose focus?

What I'm trying to do is make it so that certain text is immediately replaced with new text when its typed but you can continue typing

© Stack Overflow or respective owner

Related posts about JavaScript