I am trying to make a Yes/No input change the function of a button. If the input is Yes then I want the button to be a hyper link, but if it is a no I want it to take you to the next div (once the button is clicked)
I have NO idea how to do this.
Here is what I have
I am imagining I need a jquery thing to start like this:
$('input:radio[name="yes"]').change(
function(){
if ($(this).val() == 'Yes') {
$('.1').css('display', 'block');
}
else {
$('.2').css('display', 'block');
}
});
I tried giving the buttons a different class and then trying to have the show up, but that wasn't working.
<form>
<input type="radio" name="yes" value="Yes"/>Yes
<input type="radio" name="yes" value="No"/>No
</form>
<a href="#"><button>Yes</button></a>
<button class="no">No</button>
This is what the buttons would look like
Any help would be great!