0
Unless of I use <script> in my HTML, can Inspect element show my javascript code?
3 Réponses
+ 3
Cheese Burger Joe maybe it wouldn't show the content of the script in the inspector tool if the src attribute was used to load a script from a file. However you can always click on the src attribute to show the JavaScript file in a new tab and the debugger also lists all scripts that were loaded on a page. It's impossible to hide JavaScript code, but you can minify it or use other methods to make it harder to read.
+ 2
There is no other way than a script tag to run JavaScript in HTML, so you can inspect any script you want in your browsers dev tools. Btw. there's also a console and a debugger section in the dev tools usually that help you a lot to debug your code.
+ 1
Aaron Eberhardt I know that you cant put javascript in HTML without <script>, but I mean if you had a seperate index.js file. Would that still show?