html - Is it possible to make <script> tags visible? -


i make script tag visible. possible?

i don't know why want that, simple css should trick:

<!doctype html> <head>   <title>sample page</title>   <style type="text/css">     script {       display:block;     }   </style> </head> <body>   <script type="text/javascript">     (var = 0; < 10; i++) {       console.log("why?");     }   </script> </body> 

https://jsfiddle.net/0v2wo3a2/

edit: if script in <head>, you'll have make head visible, too:

<style type="text/css">   head, script {     display:block;   } </style> 

also, mike pointed out in comments, looking option:

&lt;script type="text/javascript"&gt;<br/> &nbsp;&nbsp;for (var = 0; < 10; i++) {<br/> &nbsp;&nbsp;&nbsp;&nbsp;console.log("why?");<br/> &nbsp;&nbsp;}<br/> &lt;/script&gt; 

this looks bad, more self explanitory in fiddle: https://jsfiddle.net/0v2wo3a2/1/


Comments

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -