javascript change value of button

前端 未结 4 518
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-19 14:18

How do I change the value of this button? I am looking at a tutorial, but only the url seems to change, and not the button.

4条回答
  •  有刺的猬
    2020-12-19 14:48

    Use innerHTML:

    document.form1.button1.innerHTML=new Date();
    

    UPDATE: Alternative you could define your button like:

    
    

    In that case

    document.form.button.value=new Date();
    

    should work as you had expected .

提交回复
热议问题