I have two checkbox and I want when i click on one of them, it to be active. Also I want when I press the second checkbox to hide one input area. How can happen this?
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-9">
<title>jquery to Show/Hide a Div</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#dosya").css("display","none");
$("#embed").css("display","none");
$("#checkdosya").click(function(){
if ($("#checkdosya").is(":checked")){
$("#dosya").show("fast");
}else{
$("#dosya").hide("fast");
}
});
$("#checkembed").click(function(){
if ($("#checkembed").is(":checked")){
$("#embed").show("fast");
}else{
$("#embed").hide("fast");
}
});
});
</script>
<style type="text/css">
<!--
label {
display: block;
}
-->
</style>
</head><body>
<div style="width: 500px;">
<form style="position: static;">
<label for="name">Name:</label>
<input id="name" type="text">
<label for="checkbox">Check to enter your email address:</label>
<input id="checkdosya" type="checkbox" name="R1" value="V1"> <input id="checkembed" type="checkbox" name="R1" value="V1">
<div style="display: none; opacity: 0.9999;" id="dosya">
<label for="email">Email Address:</label>
<input id="email" type="text">
</div>
<div style="display: none; opacity: 0.9999;" id="embed">
<label for="email">Email Address 2:</label>
<input id="email" type="text">
</div>
</form>
</div></body></html>