"How to start programming in JavaScript?"[PL]
Bartłomiej Sobczuk
We talk about JavaScript. Each month in Warsaw, Poland.
It's confusing at the beginning
For now, all we care about it that DOM provides interface to access elements and their properties with JavaScript and do whatever we want to them
<!DOCTYPE html>
<html lang="en">
<head>
<title>My First Page</title>
<meta charset="utf-8">
<link rel="stylesheet" href="./styles/styles.css">
<script type="text/javascript" src="./scripts/main.js">
</head>
<body>
<div class="big-div">
<p id="big-par"> Hello World! </p>
</div>
</body>
</html>
.big-div {
width: 500px;
}
#big-par {
font-size: 30px;
}
(function () {
var paragraph = document.querySelector("#big-par");
window.setTimeout(function () {
paragraph.innerHTML = "Hello WarsawJS!";
paragraph.style.fontSize ="60px";
paragraph.style.color = "red";
paragraph.style.textAlign ="center";
}, 5000);
}());
Hello World!