【问题标题】:Is it okay to add "onchange" event directly to the html code? [duplicate]直接在html代码中添加“onchange”事件可以吗? [复制]
【发布时间】:2022-01-02 15:19:09
【问题描述】:

我读到向 html 添加样式或诸如“onclick”之类的 javascript 是不好的做法。我想知道同样适用于“onchange”事件吗?

<select name ="backdrop" onchange="buttonChanger(this)">

【问题讨论】:

    标签: javascript html


    【解决方案1】:

    drawbacks of onclick attributes 适用于所有 on* 属性。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-22
      • 2017-05-22
      • 2019-02-26
      相关资源
      最近更新 更多