<input type="text" name="field-name-here" onclick="this.value='';" onfocus="this.select()" onblur="this.value=!this.value?'Enter Email To Get Updates':this.value;" value="Enter Email To Get Updates" />
html 点击清除输入值
<!-- Two functions to add to the input -->
<script>
// If value is blank, the value becomes the "default" value, which in this case, is "Email"
function onBlur(el) {
if (el.value == '') {
el.value = el.defaultValue;
}
}
// If you click inside the input, the default value clears, and the value becomes what is typed into the input box
function onFocus(el) {
if (el.value == el.defaultValue) {
el.value = '';
}
}
</script>
<!-- Form -->
<form method="post" v65js="emailSubscribe">
<input name="contactType" value="Newsletter" type="hidden">
<input name="email" value="Email" type="text" onblur="onBlur(this)" onfocus="onFocus(this)">
<button type="submit" class="defaultBtn">
<span>Subscribe</span>
</button>
</form>