Html
hide all the elements in 4 seconds <p>
<html>
<!-- heading -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<!-- page -->
<body>
<!-- connect the library jQuery -->
<script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>
<!-- html Elements -->
<p style='color:green; font-size:26px;'>Hello!</p>
<p style='color:orange; font-size:26px;'>World</p>
<!-- the page has opened -->
<script>
$( document ).ready(function()
{
// hiding all the elements p in 4 seconds
$("p").hide(4000);
});
</script>
</body>
</html>
Html
the link does not open when you click on an item <a>
<html>
<!-- heading -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<!-- page -->
<body>
<!-- connect the library jQuery -->
<script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>
<!-- html Elements -->
<a href="https://dir.by">My link!</a>
<a href="https://yandex.ru">Super!</a>
<!-- the page has opened -->
<script>
$( document ).ready(function()
{
// Write your handler for clicking on the link
$("a").click( function(event)
{
// see the message "Hello"
alert("Hello");
// remove the standard link open handler (that is, the link does not open)
event.preventDefault();
});
});
</script>
</body>
</html>
Html
set the name "book!!!!!" for elements <input> with class mySuper
<html>
<!-- heading -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<!-- page -->
<body>
<!-- connect the library jQuery -->
<script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>
<!-- html Elements -->
<input type="button" value="Hello" class='mySuper'>
<input type="button" value="World">
<input type="button" value="Good" class='mySuper'>
<!-- the page has opened -->
<script>
$( document ).ready(function()
{
// set the name "book!!!!!" for elements <input> with class mySuper
$("input.mySuper").val("book!!!!!");
});
</script>
</body>
</html>
Html
add a class to the reference
<html>
<!-- heading -->
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<!-- page -->
<body>
<!-- connect the library jQuery -->
<script src="https://dir.by/example_lib/jquery/jquery-3.3.1.min.js"></script>
<!-- style -->
<style>
.my1 {font-weight:bold; color:green;}
</style>
<!-- reference -->
<a href='https://dir.by'>Hello!</a>
<!-- the page has opened -->
<script>
$( document ).ready(function()
{
// add a class to the reference "my1"
$("a").addClass("my1");
});
</script>
</body>
</html>