how can i do this using javascript?
my textbox has a default value which is italic but when it is clicked the textbox will be cleared and the fontstyle should be normal.
how can i do this using javascript?
my textbox has a default value which is italic but when it is clicked the textbox will be cleared and the fontstyle should be normal.
set the style in javascript method:
document.getElementById('test').style="font-style:normal;"
try something like that :
<input type="text" value="Enter user ID here"
style="font-style:italic;"
onfocus="this.value='';this.style.fontStyle='normal';"
onblur="clickrecall(this,'Enter user ID here');this.style.fontStyle='italic';">
EDIT : As we clear the format when user enters the textbox, we should set the fontStyle to italic back when he goes out.