Mon Dec 31, 2012 10:05 pm
<html>
<head>
<title>Remove & Empty</title>
<!--
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
Note you can download the JQuery package instead of using Google version. -->
<script src="jquery-1.8.3.js"></script>
<script>
$(document).ready(function(){
// Remove HTML element
$("button#B1").click(function(){
$("#part1").remove();
});
// Remove HTML content
$("button#B2").click(function(){
$("#part2").empty();
});
});
</script>
</head>
<body>
<button id="B1">Remove</button>
<button id="B2">Empty</button>
<div id="part1" style="background:#0222F1;color:#F0F0F0;height:58px;width:300px;">
This html element will be removed after u click on Remove.</div>
<div id="part2" style="background:#F22201;color:#F0F0F0;height:58px;width:300px;">
The content of this element will be remove once u click on Empty </div>
</body>
</html>
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.