How to pass the button value into my onclick event function?

后端 未结 5 2066
失恋的感觉
失恋的感觉 2020-12-24 13:12
test

The dosomething function evoked when to click the button,how can pa

5条回答
  •  醉话见心
    2020-12-24 14:06

    You can get value by using id for that element in onclick function

    function dosomething(){
         var buttonValue = document.getElementById('buttonId').value;
    }
    

提交回复
热议问题