Changing button text onclick

后端 未结 18 2536
野性不改
野性不改 2020-11-27 03:10

When I click on myButton1 button, I want the value to change to Close Curtain from Open Curtain.
HTML:

<         


        
18条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-27 04:04

    There are lots of ways. And this should work too in all browsers and you don't have to use document.getElementById anymore since you're passing the element itself to the function.

    
    
    
    

提交回复
热议问题