Javascript and Anchor Tags, Best Practice?

后端 未结 5 688
梦如初夏
梦如初夏 2021-01-04 02:17

Quick Question.

Should we put Javascript in the HREF or use onClick (event)?

Are there any pros/cons to using either one. Personally I think it\'s easier/cle

5条回答
  •  無奈伤痛
    2021-01-04 02:58

    In the onclick event (although assigned with JS rather then the attribute) with a sensible href attribute. Build on things that work

提交回复
热议问题