JavaScript – data output

Inside the html code, you can insert and execute JavaScript using the <script>…</script> tags, which can be inserted into the head of the page.

Data output is different depending on the interpreter:

var cat = “vera”; //cat’s name
document.write(‘Hi, ‘ + cat); print the result to the user
print(‘Hi, ‘ + cat); //one output in the Visual console, but in the browser this function starts printing the page on the printer
console.log(‘Hi, ‘ + cat); //another output option, works in the Google Chrome console
Hi, Vera //result

How to use external file in code?

To connect files in JavaScript, use the src (search) function inside the tags <script src=”file name”>…</script>

This entry was posted in Javascript (en). Bookmark the permalink.

Leave a Reply

🇬🇧 Attention! Comments with URLs/email are not allowed.
🇷🇺 Комментарии со ссылками/email удаляются автоматически.