How to clear a textbox using javascript

前端 未结 15 2148
失恋的感觉
失恋的感觉 2020-12-05 09:45

I have a


I need a javascript method to clear the value of the textbox when the focus is

15条回答
  •  自闭症患者
    2020-12-05 10:24

    For my coffeescript peeps!

    #disable Delete button until reason is entered
    $("#delete_event_button").prop("disabled", true)
    $('#event_reason_is_deleted').click ->
        $('#event_reason_is_deleted').val('')
        $("#delete_event_button").prop("disabled", false)
    

提交回复
热议问题