Changing button text onclick

后端 未结 18 2550
野性不改
野性不改 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:02

    this can be done easily with a vbs code (as i'm not so familiar with js )

    
    
    

    and you're done , however this changes the Name to display only and does not change the function {onclick} , i did some researches on how to do the second one and seem there isnt' something like

    btn.onclick = ".."
    

    but i figured out a way using <"span"> tag it goes like this :

    
      
      
      
      
      
    

    try it yourself , change the codes in sub function1 and sub function2, basically all you need to know to make it in jscript is the line

    span.InnerHTML = "..." 
    

    the rest is your code you wanna execute

    hope this helps :D

提交回复
热议问题