<input type="button" value="Hide Box" class="button-hide" />
<input type="button" value="Show Box" class="button-show" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$('.button-show').click(function(){
$("#box").show();
$("#box1").hide();
});
$('.button-hide').click(function(){
$("#box").hide();
$("#box1").show();
});
});
</script>
<script>
$(document).ready(function() {
$("#box").hide();
$("#box1").hide();
});
</script>
<form action="#" method="get" class="sidebar-form" id="box">
<div class="input-group">
<p>this is show content </p>
</div>
</form>
<form action="#" method="get" class="sidebar-form" id="box1">
<div class="input-group">
<p>this is hide content </p>
</div>
</form>
No comments:
Post a Comment