keep placeholder on focus in IE10

前端 未结 7 1298
Happy的楠姐
Happy的楠姐 2020-11-30 05:42

Under WebKit and Firefox, the text in a input\'s placeholder sticks around on focus—it doesn\'t disappear until input.val

7条回答
  •  旧巷少年郎
    2020-11-30 05:57

    The trick is to call focus() and select() both on the input element.

    $("#elementId" ).focus();
    $("#elementId" ).select();
    

提交回复
热议问题