suchen

Heim  >  Fragen und Antworten  >  Hauptteil

javascript - Wenn ich JS in ein verstecktes Div schreibe, werden die JS darin ausgeführt?

`<p style="display:none;">
<script>
Wird der Code hier ausgeführt?
</script >
</p>`

PHP中文网PHP中文网2859 Tage vor489

Antworte allen(2)Ich werde antworten

  • phpcn_u1582

    phpcn_u15822017-05-18 10:53:40

    会的。display:none只是隐藏,实际内容还在

    Antwort
    0
  • 迷茫

    迷茫2017-05-18 10:53:40

    当然可以咯。节点只是隐藏了,但还在dom树中。

    Antwort
    0
  • StornierenAntwort