Edit in JSFiddle

$("#s").focus(function() {
    if (this.value == this.defaultValue) {
        this.value = "";
    }
}).blur(function() {
    if (!this.value.length) {
        this.value = this.defaultValue;
    }
});

              
<input type="text" name="example" id="s" value="search"><input type="submit" value="search" class="btn">