Get element from which onclick function is called

前端 未结 8 1022
野趣味
野趣味 2021-01-18 03:59

I have a button with a onclick attribute which is pointing to the function test().


<         


        
8条回答
  •  感动是毒
    2021-01-18 04:35

    just add id to each button and pass it to your test function

    and here is working jsfiddle

    
    
    
    
    
    

提交回复
热议问题