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.
55 lines
2.4 KiB
55 lines
2.4 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>Změna písmen</title>
|
|
<link rel="stylesheet" href="style.css">
|
|
</head>
|
|
<body>
|
|
<h1>Testovač písmen</h1>
|
|
<div id="first">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Sapiente veniam commodi, eius natus adipisci illo ipsa maiores explicabo debitis magnam itaque perspiciatis quae, voluptatum quasi hic delectus dolorem ad optio.</div><br>
|
|
<div id="second">Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure fugit nulla ea assumenda voluptates, eaque id laudantium qui voluptatem ducimus perferendis adipisci fugiat aliquam, rem asperiores commodi ratione culpa quo.</div><br>
|
|
<div id="third">Lorem ipsum dolor sit amet consectetur adipisicing elit. Iure fugit nulla ea assumenda voluptates, eaque id laudantium qui voluptatem ducimus perferendis adipisci fugiat aliquam, rem asperiores commodi ratione culpa quo.</div><br>
|
|
<hr>
|
|
<button onclick="buttonNumber(1)">div č.1</button>
|
|
<button onclick="buttonNumber(2)">div č.2</button>
|
|
<button onclick="buttonNumber(3)">div č.3</button>
|
|
<button onclick="buttonNumber(4)">vše</button>
|
|
<br>
|
|
<select id="fontSeznam" size="5">
|
|
<option>Impact</option>
|
|
<option>Comforter</option>
|
|
<option>Roboto</option>
|
|
<option>Arial</option>
|
|
<option>Arial Black</option>
|
|
</select>
|
|
|
|
<script>
|
|
function buttonNumber(divNum) {
|
|
let fontlist = document.getElementById("fontSeznam");
|
|
//e.options[e.selectedIndex].text
|
|
let futureFont = fontlist.options[fontlist.selectedIndex].text;
|
|
//alert(futureFont)
|
|
if (divNum == 1){
|
|
document.getElementById("first").style.fontFamily = futureFont;
|
|
} else if (divNum == 2){
|
|
document.getElementById("second").style.fontFamily = futureFont;
|
|
} else if (divNum == 3){
|
|
document.getElementById("third").style.fontFamily = futureFont;
|
|
} else if (divNum == 4){
|
|
document.getElementById("first").style.fontFamily = futureFont;
|
|
document.getElementById("second").style.fontFamily = futureFont;
|
|
document.getElementById("third").style.fontFamily = futureFont;
|
|
} else {
|
|
alert("Stiskl si špatně");
|
|
}
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html>
|