You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<title>Pocitadlo</title>
|
|
</head>
|
|
<body>
|
|
<button onclick="pridat()">Pridat</button>
|
|
<br>
|
|
<button onclick="odebrat()">odebrat</button>
|
|
<br>
|
|
<button onclick="vynulovat()">vynulovat</button>
|
|
|
|
<p><div id="cislo">50</div>px</p>
|
|
|
|
<p id="bigtext" style="font-size: 50px">Lorem ipsum dolor sit amet consectetur adipisicing elit. Ipsum, veniam est aliquid quia fugit officiis error ratione? Repellat quam magnam maxime, quo dolorem, ab neque illum tempora natus sed blanditiis!</p>
|
|
|
|
<script>
|
|
function pridat() {
|
|
var x = document.getElementById("cislo").innerHTML;
|
|
x = parseInt(x)+1;
|
|
document.getElementById("cislo").innerHTML = x;
|
|
document.getElementById("bigtext") = x+"px";
|
|
|
|
}
|
|
function odebrat() {
|
|
var x = document.getElementById("cislo").innerHTML;
|
|
x = parseInt(x)-1;
|
|
document.getElementById("cislo").innerHTML = x;
|
|
document.getElementById("bigtext").style.fontSize = x+"px";
|
|
}
|
|
|
|
function vynulovat() {
|
|
document.getElementById("cislo").innerHTML = "100px";
|
|
document.getElementById("bigtext").style.fontSize ="50px";
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|