搜索框点进原有提示语消失

<script language="javascript" type="text/javascript">

function clearText(field)
{
if (field.defaultValue == field.value) field.value = '';
else if (field.value == '') field.value = field.defaultValue;
}

</script>

 

<div id="search_box">
<form action="#" method="get">
<input type="text" value="Enter a keyword here..." name="q" size="10" id="searchfield" title="searchfield" onfocus="clearText(this)" onblur="clearText(this)" />
<input type="submit" name="Search" value="" id="searchbutton" title="Search" />
</form>
</div>

posted @ 2014-08-08 11:49  也许明天  阅读(264)  评论(0编辑  收藏  举报