android - Onkeydown failed to work on (screen touch ) -
i have textbox default value onkeydown should cleared default value seems i'm not able fix please me on this.
this script
$('input').keydown(function () { this.value = "" }); $('input').blur(function () { if (this.value = "") { this.value = this.title; } });
you want use focus() not keydown() clearing default text, otherwise won't possible type in box. secondly, javascript case sensitive, should if, not if, , need use == comparison operator.
$('input').focus(function () { this.value = "" }); $('input').blur(function () { if (this.value == "") { this.value = this.title; } });
Comments
Post a Comment