/ Published in: JavaScript
Nice little snippet. Should be used on all text fields in my opinion.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<form action="search.php" method="get"> <input type="text" name="q" size="40" class="q" id="q" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" /> <input type="submit" value="Search"> </form>