How do you write this code so the text will disappear once the user clicks on the input area, and also that it will reappear if the user clicks somewhere else? Right now the default text is "Search..." and it stays there until someone starts to write something into the search, they have to press and actual letter on there keyboard before the default text disappears. In short and the easiest way to explain this is by example, see the little search box on the right-hand side above the widgets area here just above the google+ twitter and facebook like count buttons on this forum? I want it to behave like that, when you click into the text area the "Search..." text disappears, and when you click out of it it reappears again.
- Code:
$(window).load(function() {
document.getElementById('fa_search').getElementsByTagName('input')[0].setAttribute('placeholder','Search...');
});