2014-04-02 117 views
0

我想要一個javascript或jquery我不知道哪一個,當我按fift收音機按鈕然後點擊旁邊發送給我另一個html頁面。 如果你能給我一個例子,我將不勝感激。 PS對不起我的英文不好:d 這裏是一個例子Javascript onclick或jquery觸發器

</head> 

<body> 

<p>please select a year</p> 
<form action="picture2.html"> 
<input type="radio" name="answer" value="2years">0-2 years<br> 
<input type="radio" name="answer" value="2years">3-5 years<br> 
<input type="radio" name="answer" value="2years">6-10 years<br> 
<input type="radio" name="answer" value="2years">More than 10 years<br> 
<input type="radio" id="demo" name="answer" value="terminate">i have 20 years (if this is selected go to another html page)<br> 
<input type="button" id="button" onclick="myFunction" value="Next"> 
</form> 


<script> 
$(function(){ 
    $("input:radio:fifth").click(myFunction(); 
}); 

function myFunction() 
{ 
document.getElementById("button").onclick="window.location.href='picture2.html'"; 
} 
</script> 

</body> 
</html> 
+0

下一意味着下一個按鈕你英語權 –

+0

是的下一個按鈕,我試過......但我卡住了 – user3383503

+1

即使你的問題並不清楚,你也沒有給出任何代碼,先嚐試一下,如果卡住了,就會附帶代碼。 –

回答

0

請按照下面給出的鏈接:

http://jsfiddle.net/u8jD9/

http://jsfiddle.net/nnEny/

if ($('#rdo1').is(':checked')) { 
        window.location.replace("http://www.stackoverflow.com"); 
       } 
       else if ($('#rdo2').is(':checked')) { 
        window.location.replace("http://www.exchange.com"); 
       }