-3
I’m trying to run my first javascript. But when I click the button I created, the text that should appear on the screen does not appear. Where am I missing? My browser is updated so it should run Javascript 1.8.5. Even so I tried even setting version 1.1 and it doesn’t work the same...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 5.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<HTML>
<HEAD>
<TITLE>Menu</TITLE>
<script language = "JavaScript1.8.5">
function teste1(){
document.write("<h1>Teste1 foi acionado!!!</h1>")
var teste = new Object();
teste.x = 2,4;
teste.y = 5;
document.write(teste.x)
</script>
</HEAD>
<BODY>
<input type="button" value="Teste 1" onClick="teste1()">
</BODY>
</HTML>
It worked! But it seems that the script never stops running, because the browser page is "loading" forever. As you can see, I put the </script> at the end...
– Lucas Pletsch
Should I disagree about the statement right at the beginning of the answer? I see no lack of quotation marks, nor in the history of the question. I saw other adjustments in the code and what I realized helped actually (I may be wrong) was the key lock function
}
, as the dvd put in the other answer– Jefferson Quesado