www.webdeveloper.com
Results 1 to 2 of 2

Thread: Deselecting text in an INPUT text box

  1. #1
    Join Date
    Oct 2004
    Posts
    3

    Deselecting text in an INPUT text box

    This is a weird Mozilla/Firefox problem I've encountered which doesn't happen in IE at all and need to be able to undo in Firefox/Mozilla.

    The problem is that whenever a text input box gets focus, it automatically selects all text within it. Even if text is generated into that box while it has focus, the text is selected.

    document.selection.empty();
    will clear the box of all text (when it works).
    document.selection.clear();
    will also clear the box of all text (when it works).

    How do you deselect text in an < INPUT > text box in Mozilla/Firefox when it comes into focus?

  2. #2
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    Use blur(), maybe?
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles