I´m still new to javascript.For training purpose I have inserted part of a javascript(lines 23 to 31) code into my html file and it works the windows.alert and number 12 shows
But when i uncomment parts of it (lines 26 to 28) that javascript code doesnt work well again,the windows.alert and number 12 dont show
Is my initiation of the 2dimensional array wrong or am I only allowed to initiate that 2dimensional array within a function or external file ? For better readabilty i have shortened the html file.
<!DOCTYPE html>
<html>
<head>
<title>Home</title>
<meta http-equiv="Content-Type" content="text/html; charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
</head>
<body>
<header><h1 style="display:inline;position:relative;top:10%;">Deine Pizzeria</h1>
</header>
<p id="demo"></p>
<section id="maincontainer"><div class="resize"></div>
<section id="upleft" class="navilinks"><a href="index.html">Home</a>
</section>
<section id="upright" class="navilinks"><a href="speisemenue.html">Speisemenü</a>
</section>
<section id="downleft" class="navilinks"><a href="kontakt.html">Kontakt</a>
</section>
<section id="downright" class="navilinks"><a href="anfahrt.html">Anfahrt</a>
</section>
</section>
<script>
window.alert(5 + 6);
/*var pizzen = [["Mageritha",4.90],["Cardinale",5.90],["Salami",6.90]];
var salate = [["Insalata Mista"],3.5],["Insalata Polo"],5],["Insalata Tonno"],5.5]];
var suppen = [["Tomatencremesuppe"],2.8],["Knoblauchcremesuppe"],2.9],["Frittatensuppe"],3]];*/
document.getElementById("demo").innerHTML = 5 + 7;
</script>
</body>
</html>