Radio buttons to go to new page - Javascript jQuery

Javascript examples for jQuery:Form Button

Description

Radio buttons to go to new page

Demo Code

ResultView the demo in separate window


<html>
 <head> 
  <script src="https://code.jquery.com/jquery-1.9.1.min.js"></script> 
 </head> //from  ww w.j  a va2 s.  co  m
 <body> 
  <label for="x"> <input type="radio" name="x" value="stupid" id="x" checked action="stupid.php"> <span>stupid</span> </label> 
  <br> 
  <script>
$("input[type=radio]").click(function() {
         window.location.href = $(this).attr("action");
});

      </script>  
 </body>
</html>

Related Tutorials