Skip to content

Instantly share code, notes, and snippets.

@gentle-media
Created July 2, 2013 10:46
Show Gist options
  • Save gentle-media/5908366 to your computer and use it in GitHub Desktop.
Save gentle-media/5908366 to your computer and use it in GitHub Desktop.
Change through a radio button a href with jQuery
/**
* Change through a radio button a href with jQuery
*/
body {
background: #fff;
min-height: 100%}
<script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
$('input[name=radio-group-1]:radio').change(function() {
if ($(this).val() == 'yes') {
$('.btn[href=#pagina-04]').attr("href","#pagina-06");
}
else {
$('.btn[href=#pagina-04]').attr("href","#pagina-04");
}
});
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"javascript"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment