I need that when a radio button is selected, lower the screen automatically. I have this HTML code:
<label><input type="radio" name="radio" value="1" id="boton1" class="ancla" data-ancla="scroll" /></label>
<label><input type="radio" name="radio" value="2" id="boton2" class="ancla" data-ancla="scroll" /></label>
and this JavaScript code:
$('.ancla').on('click', function(e){
e.preventDefault();
var strAncla = '#' + $(this).data('ancla');
$('html,body').animate({scrollTop: $(strAncla).offset().top}, 1500);
});
But when clicking, it does what I want but it does not select any radio button that I will use later to save it in the database.
How do I solve it? Thanks!