books/javascript.html

85 lines
2.4 KiB
HTML
Raw Normal View History

2024-05-13 15:33:18 +02:00
<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' id='site' href='http://changbin.borec.cz/druhy_polrok/javascript.css'
='text/css' media='all' />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js">
</script>
background-color:rgb(115, 144, 114);
<script>
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
});
</script>
<script type="text/javascript">
var farba;
$(document).ready(function(){
$("#button2").click(function(){
$(".img1").css("border-color", "rgb(115, 144, 114)");
$("#container1").css("border-color", "rgb(115, 144, 114)");
farba = "purple";
alert(farba);
//alert($(".img1").css("border-left-color"));
});
});
</script>
</head>
<body>
<h1>1</h1>
<button type="button" onclick="document.getElementById('demo').innerHTML = Date()">
Click me to display Date and Time.</button>
<p id="demo"></p>
<h1>2</h1>
<p id="demo1">JavaScript can change the style of an HTML element.</p>
<script>
function myFunction() {
document.getElementById("demo1").style.fontSize = "25px";
document.getElementById("demo1").style.color = "red";
document.getElementById("demo1").style.backgroundColor = "yellow";
}
</script>
<button type="button" onclick="myFunction()">Click Me!</button>
<h1>3</h1>
<button id="hide">Hide</button>
<button id="show">Show</button>
<p>This is a paragraph with little content.</p>
<p>This is another small paragraph.</p>
<p>https://www.w3schools.com/jquery/</p>
<p>https://www.w3schools.com/html/html_scripts.asp</p>
<h1>4</h1>
<img class="img1" src="https://th.bing.com/th/id/OIP.Ipthu4QkznRjxH4oSQaPiwHaLE?rs=1&pid=ImgDetMain" style="width:300px;">
<script type="text/javascript">
function rozlisenie()
{
winwidth=document.all?document.body.clientWidth:window.innerWidth;
winHeight=document.all?document.body.clientHeight:window.innerHeight;
alert(winwidth+"px, "+winHeight+" px");
}
</script>
<button id="button2">Zmen farbu</button>
<button onclick="rozlisenie()" id="button1">Rozlisenie</button>
</body>
</html>