Q#1. Jquery Load Content Inside An Element From A File
Q#1. Jquery Load Content Inside An Element From A File
Q#1. Jquery Load Content Inside An Element From A File
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("#box").load("/examples/html/test-content.html");
});
});
</script>
</head>
<body>
<div id="box">
</div>
</body>
</html>
<html lang="en">
<head>
<meta charset="utf-8">
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$.get("/examples/php/date-time.php", function(data){
$("#result").html(data);
});
});
});
</script>
</head>
<body>
<div id="result">
<h2>Content of the result DIV box will be replaced by the server date and time</h2>
</div>
</body>
</html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
.page-header{
color: red;
text-transform: uppercase;
.highlight{
background: yellow;
</style>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("h1").removeClass("page-header");
$("p").removeClass("hint highlight");
});
});
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
.page-header{
color: red;
text-transform: uppercase;
.highlight{
background: yellow;
</style>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
$("h1").removeClass();
$("p").removeClass();
});
});
</script>
</head>
<body>
</body>
</html>
Q#5. Method chaining in jQuery
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<style type="text/css">
p{
width: 200px;
padding: 40px 0;
text-align: center;
background: #aaccaa;
box-sizing: border-box;
</style>
<script type="text/javascript">
$(document).ready(function(){
$(".start").click(function(){
});
$(".reset").click(function(){
$("p").removeAttr("style");
});
});
</script>
</head>
<body>
<p>Hello World!</p>
</body>
</html>