2
I am following the firefox tutorial but I am not able to run a hello word. Follow the code.
HTML code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Javascript 01</title>
<script type="text/javascript" src="scripts/main.js"></script>
</head>
<body>
<h1>Teste</h1>
</body>
</html>
Javascript code
alert('123');
var myHeading = document.querySelector('h1');
myHeading.textContent = 'Hello world!';
The alert
works, ta getting there. I wondered why you didn’t change the text of h1
for Hello Word.
Welcome to Stackoverflow in English. I edited your question to remove the greetings, as we usually keep them as clean as possible to focus on your scheduling question. If you are interested in visiting a part of the site that is not aimed to ask questions can know the Stack Overflow Chat in Portuguese. If you have questions about the operation, rules and procedures of the site visit the Stack Overflow in English Meta :)
– Jéf Bueno