Onclick event to remove default value in a text input field

前端 未结 9 1255
傲寒
傲寒 2021-02-02 14:57

I have an input field:


How would I get it to remove the pre-defined text (Enter Your Name

9条回答
  •  有刺的猬
    2021-02-02 15:08

    As stated before I even saw this question placeholder is the answer. HTML5 for the win! But for those poor unfortunate souls that cannot rely on that functionality take a look at the jquery plugin as an augmentation as well. HTML5 Placeholder jQuery Plugin

    
    

提交回复
热议问题