Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it allowed to use the script tag inside the paragraph tag? - HTML5

Tags:

html

Is it allowed to use the script tag inside the paragraph tag? - HTML5

like image 415
WQC Avatar asked Nov 16 '25 02:11

WQC


2 Answers

Yes, you can. It's not recommended to use inline scripts whenever it can be avoided, but it's valid syntactically.

like image 123
j08691 Avatar answered Nov 17 '25 22:11

j08691


Yes.

<html>
  <head>
    <title></title>
  </head>
  <body>
    <p>
      <script>
      </script>
    </p>
  </body>
</html>

Check in http://validator.w3.org/check , override DOCTYPE to HTML5

like image 27
Imp Avatar answered Nov 17 '25 21:11

Imp