How to clear text field on focus of text field

前端 未结 9 1972
悲&欢浪女
悲&欢浪女 2020-12-29 12:15

I want to clear the text field when the user clicks on that

9条回答
  •  离开以前
    2020-12-29 12:42

    function Clear (x) {if (x.cleared) {} else {x.value = ""; x.cleared = true}}
    
    onfocus = "Clear (this)"
    

提交回复
热议问题