get the value of “onclick” with jQuery?

前端 未结 6 646
耶瑟儿~
耶瑟儿~ 2020-12-09 15:16

Is it possible to get the current value of the onClick attribute of an A tag via jQuery?

For example, I have:



        
6条回答
  •  有刺的猬
    2020-12-09 15:53

    i have never done this, but it would be done like this:

    var script = $('#google').attr("onclick")
    

提交回复
热议问题