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

前端 未结 10 1935
面向向阳花
面向向阳花 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条回答
  •  清歌不尽
    2020-12-10 02:43

    It should only be used in the href tag.

    That's ridiculous.

    The accepted way is this:

    Blah
    

    But to answer the OP, there is generally no reason to use javascript: anymore. In fact, you should attach the javascript event from your script, and not inline in the markup. But, that's a purist thing I think :-D

提交回复
热议问题