What's the purpose (if any) of “[removed]” in event handler tags?

前端 未结 10 1911
面向向阳花
面向向阳花 2020-12-10 02:26

I\'ve been making a concerted effort to improve my javascript skills lately by reading as much javascript code as I can. In doing this I\'ve sometimes seen the javascr

10条回答
  •  萌比男神i
    2020-12-10 02:46

    Probably nothing in your example. My understanding is that javascript: is for anchor tags (in place of an actual href). You'd use it so that your script can execute when the user clicks the link, but without initiating a navigation back to the page (which a blank href coupled with an onclick will do).

    For example:

    Blah
    

    Rather than:

    Blah
    

提交回复
热议问题