I have a text field, the mark-up of which I cannot directly edit:
<input type="text" name="email" value="Email Address" id="subscribe-field"
onclick="if ( this.value == 'Email Address' ) { this.value = ''; }"
onblur="if ( this.value == '' ) { this.value = 'Email Address'; }">
I need the text field value to be blank regardless of whether the text field is clicked, not clicked or clicked out of.
I can disable the value:
$('#subscribe-field').val('');
I've tried to disable the onclick and onblur values:
$('#subscribe-field').click(function() { return false; });
$('#subscribe-field').off('click');
$('#subscribe-field').unbind('click');
...however, the value reappears as soon as I click outside of the text field.
How do I remove the onblur value from the above mark-up?
try this way :
$('#subscribe-field').removeAttr('onclick');
$('#subscribe-field').removeAttr('onblur');