using radios to show/hide
Hey Ray
In this code, how would I modify it so that if the radio 'paypal' is selected it hides the output?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style type="text/css">
.invoice{
padding: 20px;
display: none;
margin-top: 20px;
border: 1px solid #000;
}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('input[type="radio"]').click(function(){
if($(this).attr("value")=="invoice"){
$(".invoice").not(".invoice").hide();
$(".invoice").show();
}
});
});
</script>
</head>
<body>
<div>
<label><input type="radio" name="colorRadio" value="paypal"> paypal</label>
<label><input type="radio" name="colorRadio" value="invoice"> invoice</label>
</div>
<div class="invoice">You have selected <strong>invoice radio button</strong> </div>
</body>
</html>