You are on page 1of 6

PHP & MYSQL

Assignment-5
QUESTION-1
<html>
<head>
<script src='jquery.min.js'></script>
<Script>
$(document).ready(function(){
$("#btn1").click(function(){
$("p").append("<b>Append item</b>");
})
});
$(document).ready(function(){
$("#btn2").click(function(){
$("ol").append("<li>Append item</li>");
});
});
</script>
</head>
<body>
<p>This is a heading</p>
<p>This is a paragraph</p>
<ol>
<li>List Item 1 </li>
<li>List Item 2 </li>
<li>List Item 3 </li>
</ol>
<button id="btn1">Append Text</button>
<button id="btn2">Append List Items</button>
</body>
</html>

PATEL SHAMIYA[ 19BCA18 ] page. 1


PHP & MYSQL

OUTPUT:

PATEL SHAMIYA[ 19BCA18 ] page. 2


PHP & MYSQL

QUESTION-2
<html>
<head>
<script src='jquery.min.js'></script>
<script>
$(document).ready(function(){
$("#btn1").click(function(){
$("img").before("<b> before </b>");
});
$("#btn2").click (function(){
$("img").after("<i> After </i>");
});
);
</script>
</head>
<body>
<img src="C:\wamp\www\assignment5" width="100" height="140"><br> <br>
<button id="btn1"> Insert before </button>
<button id="btn2"> Insert after </button>
</body>
</html>

OUTPUT:

PATEL SHAMIYA[ 19BCA18 ] page. 3


PHP & MYSQL

QUESTION-3
<!-- program on jQuery effect
Hide()-->

<html>
<head>

<script src='jquery.min.js'></script>
<script>
$(document).ready(function(){
$("#button").click(function(){

$("p").hide();
});
});
</script>
</head>
<body>
<h2>This is Heading</h2>
<p>This is Paragraph</p>
<p>This is another paragraph</p>

<input type="button" class="btn btn-info" id="button"


value="Click me to hide Paragraph"/>

</body>
</html>

OUTPUT:

PATEL SHAMIYA[ 19BCA18 ] page. 4


PHP & MYSQL

QUESTION:4
<html>
<head>
<script src='jquery.min.js'></script>
<Script>
$(document).ready(function(){
$("#btn1").click(function(){
$("p").prepend("<b>Prepend item</b>");
});
});
$(document).ready(function(){
$("#btn1").click(function(){
$("ol").prepend("<li>Prepend item</li>");
});
});
</script>
</head>
<body>
<p>This is a heading</p>
<p>This is a paragraph</p>
<ol>
<li>List Item 1 </li>
<li>List Item 2 </li>
<li>List Item 3 </li>
</ol>
<button id="btn1">prepend text</button>
<button id="btn2">prepend List item</button>
</body></html>
OUTPUT:

PATEL SHAMIYA[ 19BCA18 ] page. 5


PHP & MYSQL

PATEL SHAMIYA[ 19BCA18 ] page. 6

You might also like