html
html
1
2
3
4
5
6
7
8
9
10
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>JS</h1>
<div id="div" onclick="width()"> </div>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
body {
}
div{
height: 50px;
width: 50px;
background-color: red;
font-size: 20px;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
window.onload = function(){
pap = document.getElementById("div");
}
numb = 0;
setInterval(function(){
(1?numb +=1:0);
pap.innerHTML = numb}, 100);
// look at the following code
wi = 50;
function width(){
wi += 10;
pap.style.width = wi +"px";
}
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run