I have ubuntu 20.04. I create an HTML file that has a style of javaScript "prompt" and I write condition for it that if the user writes for e.x list it will console.log() a list that I creat. when I test my code when I type something in the prompt box in firefox or chrome or any browser it will be crashed when I try to bring dev tools It can not bring it up to I see the result that I wrote. what should I do?
CodePudding user response:
if you have written it in script tag other wise it will not work. If you write javascript code along with the html code, it is not going to work in anyway. So you have to write it seperately either in other js file or in the script tag inside the html file.
CodePudding user response:
You have to write it in a separate JavaScript file and not in a script tag in an HTML file. writing separately will not crash your browser.