What is the Difference between onclick and href="[removed]function name?

前端 未结 6 1681
别跟我提以往
别跟我提以往 2021-02-10 12:20

Is there any difference between

1 : Link1

and

2 : 

        
6条回答
  •  情歌与酒
    2021-02-10 12:35

    There is a difference in functionality, the first doesn't attempt to process a link. The second does.

    However, I agree with Coronatus - both methods are not ideal. I would suggest researching unobtrusive JavaScript (perhaps with jQuery) as you could dynamically add a click event to the element.

提交回复
热议问题