search

Home  >  Q&A  >  body text

javascript - If I write js inside a hidden div, will the js inside run?

`<p style="display:none;">
<script>
Will the code here run?
</script >
</p>`

PHP中文网PHP中文网2859 days ago484

reply all(2)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-18 10:53:40

    It will. display:none just hides it, the actual content is still there

    reply
    0
  • 迷茫

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

    Of course you can. The node is just hidden, but still in the dom tree.

    reply
    0
  • Cancelreply