简体   繁体   中英

how can i link my javascript file with html???? I think i have linked properly but not working?

WHAT is problem in linking javascript code to html code??? my html code:

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>PARUL</title>
    <script  src="script.js"></script>
    <script>
    console.log(x)
    </script>


</head>
<body></body>
</html>

my javascript code:

var x="hello world";

You have already linked your HTML code with your JS file. Follow these steps:

  1. Right click on your mouse and you will get the option Inspect at the bottom.
  2. Click on it and you will get the developer tool having multiple tabs in it like Elements , Console ,etc.
  3. You just need to click on the Console tab. Then you will able to see the output which you have given the statement console.log("")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM