javascript change value of button

前端 未结 4 533
佛祖请我去吃肉
佛祖请我去吃肉 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:56

    This works for sure...

    onclick="changeValue(this);"
    
    function changeValue(button)
    {
        // Changes the value of the button
        button.value = new Date();
    }
    

提交回复
热议问题