You can see the search box in question at: http://www.trailbehind.com. If the user tries to search twice, they have to press backspace a bunch to clear the text, but I'd like to select all text on double click, which inputs should do by default. Why doesn't mind?
When the users first clicks, I clear the input as follows:
input.onclick = clearInitialValue; function clearInitialValue() { this.value = ""; this.onclick = 'return True'; this.style.color = "black"; }
Another thing you might need to know to help me solve this riddle is that I used the input to instantiate a YUI autocomplete: http://developer.yahoo.com/yui/autocomplete/, but I can't find anything in the docs that explains why double-clicking the input to select text wouldn't work.