you are here: codestackercodes [RSS] → tag input [RSS]

search box onclick clear/unclear

this's used here!

<script type="text/javascript">
    function clickclear(thisfield, defaulttext) {
        if (thisfield.value == defaulttext) {
            thisfield.value = "";
        }
    }
    
    function clickrecall(thisfield, defaulttext) {
        if (thisfield.value == "") {
            thisfield.value = defaulttext;
        }
    }
</script>

<input id="search" type="text" name="q" value="search" onclick="clickclear(this, 'search')" onblur="clickrecall(this,'search')"/>

remove the mac os x glowing blue outline for input fields

input:focus { outline: none; }
Displaying all 2 Code