Langkah – langkah Menampilkan dan Menyembunyikan DIV dengan Menggunakan jQuery
<html>
<head>
<title>jQuery
Menampilkan/Menyembunyikan Element DIV - jaranguda.com</title>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script
type='text/javascript'>
$(window).load(function(){
$("#showhide").css("display","none");
$('#clickme').change(function(){
if (this.checked) {
$('#showhide').fadeIn('slow');
}
else {
$('#showhide').fadeOut('slow');
}
});
});
</script>
</head>
<body>
<input
type="checkbox" name="clickme"
id="clickme">ClickMe
<div id="showhide">
disini ditampilkan
</div>
</body>
</html>
|
<script type='text/javascript'>
$(window).load(function(){
$("#showhide").css("display","none");
$('#clickme').change(function(){
if (this.checked) {
$('#showhide').fadeIn('slow');
}
else {
$('#showhide').fadeOut('slow');
}
});
});
</script>
|
<html>
<head>
<script
type='text/javascript'>
$(window).load(function(){
$("#showhide").css("display","none");
$('#clickme').change(function(){
if (this.checked) {
$('#showhide').fadeIn('slow');
}
else {
$('#showhide').fadeOut('slow');
}
});
});
</script>
<title>Menampilkan dan Menyembunyikan DIV dengan
Menggunakan jQuery - gibutladimba.blogspot.com</title>
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script
type='text/javascript'>
$(window).load(function(){
$("#showhide").css("display","none");
$('#clickme').change(function(){
if (this.checked) {
$('#showhide').fadeIn('slow');
}
else {
$('#showhide').fadeOut('slow');
}
});
});
</script>
</head>
<body>
<input
type="checkbox" name="clickme"
id="clickme">Klik Disini
<div id="showhide">
disini ditampilkan
</div>
</body>
</html>
|