Ok i have this code
<div name="search" id="searchbox">
<div id="kk"><img src="Images/glss.png"/><input value="search item here..." type="text" id="inputbox" onclick="clickclear(this, 'search item here...')" onblur="clickrecall(this,'search item here...')"/></div><button id="submit" onclick="rr()"/> <!--onkeydown="checkForm(event);"-->
</div>
and I have this javascript function for the onclick event.
// searchbox functions ( clear & unclear )
function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value = "";
}
}
function clickrecall(thisfield, defaulttext) {
if ($q == "0"){
if (thisfield.value == "") {
thisfield.value = defaulttext;
}}
else
{
}
}
There is no problem on onclick event, as the text in #inputbox is remove when its clicked.
The problem is the onblur function, the default text on the #inputbox is not recall or not restore in onblur event.
Thanks in advance
I just stored the default value in data tag and here is the rest: http://jsfiddle.net/8DFJv/