I have a small script which adds form input fields dynamically but whenever I click the button to add a new element the screen scrolls to top, is there a way to stop that?
this is my script:
var fundadores = 1;
$('.fs_fundadores .agregar').click(function() {
fundadores ++;
$('<div class="clearfloats"><label>' + fundadores + '. Nombre</label><input class="field" type="text" value="" name="dynamicn[]"><label>Correo</label><input class="field" type="text" value="" name="dynamicem[]"></div>').fadeIn('slow').appendTo('.fs_fundadores');
});
$('.fs_fundadores .quitar').click(function() {
if ( fundadores > 1 ) {
$('.fs_fundadores').children("div:last").fadeOut().remove();
fundadores --;
}
});