My Friend Ukesh gave me this code, thanks to him for saving my time.
<input name="q" id="search_text" type="text" value="- Search -" onfocus="clearDefaultText(this)" onblur="clearDefaultText(this)" style="background:none"/>
<script>
function clearDefaultText(field){
if (field.defaultValue == field.value) field.value = '';
else if (field.value == '') field.value = field.defaultValue;
}
</script>
2 comments:
common dude, its just a Javascript :)
Yeah it takes 15-20 mins when I do it, but it took seconds to copy :):) Is there any option in the input tag for doing this kinda work??
Post a Comment