How does the way in which a JavaScript event handler is assigned affect its execution?

后端 未结 4 736
予麋鹿
予麋鹿 2020-12-21 10:50

Please, consider the following code.


Question


        
4条回答
  •  旧时难觅i
    2020-12-21 11:30

    There are no particular benefits in setting event listeners in HTML. Moreover it is considered harmful, e.g. CSP bans it https://developers.google.com/web/fundamentals/security/csp#inline_code_is_considered_harmful

提交回复
热议问题