我想让最后一个收音机的按钮转到新页面

时间:2015-03-20 09:55:33

标签: javascript jquery html redirect webpage

观看实时代码 http://jsfiddle.net/fo3660xe/

代码完全和另一个选项我可以更改文本,然后重定向可以与文本按钮的其余部分不同,可以添加并隐藏所有页面,并仅显示在重定向之前的最后一页

 <p class="text" id="first_one">
 <span>لقد تم دعوتك للدخول فى تحدى مع احد ابطالنا</span>

 <span class='poll'>
 <span>
 <input type="radio" name="radio" id="radio1" class="radio" checked/>
 <label for="radio1">1</label>
 </span>

 <span>
 <input type="radio" name="radio" id="radio2" class="radio"/>
 <label for="radio2">1</label>
 </span>

 <span> 
 <input type="radio" name="radio" id="radio3" class="radio"/>
 <label for="radio3">1</label>
 </span>

  <span>    
  <input type="radio" name="radio" id="radio4" class="radio"/>
  <label for="radio4">1</label>
  </span>
  </span>

  <br/><br/>
  </p>





 <p class="text" id="first_one">
 <span>لقد تم دعوتك للدخول فى تحدى مع احد ابطالنا</span>

 <span class='poll'>
 <span>
 <input type="radio" name="radio" id="radio1" class="radio" checked/>
 <label for="radio1">1</label>
 </span>

 <span>
 <input type="radio" name="radio" id="radio2" class="radio"/>
 <label for="radio2">1</label>
 </span>

 <span> 
 <input type="radio" name="radio" id="radio3" class="radio"/>
 <label for="radio3">1</label>
 </span>

  <span>    
  <input type="radio" name="radio" id="radio4" class="radio"/>
  <label for="radio4">1</label>
  </span>
  </span>

  <br/><br/>
  </p>

和jquery

$("#slider1next").click(function() {
var $next = $(".text:visible").hide().next('p');
$next.length ? $next.show() : window.location.replace('start.html');

});

1 个答案:

答案 0 :(得分:2)

用这个替换你的jquery。

 $("#slider1next").click(function() {
        var $next = $(".text:visible").hide().next('p');
        $next.length ? $next.show() : window.location.replace('http://jsfiddle.net/');

    });