tags:

views:

31

answers:

2

Using HTML

I want to use 2 checkbox, when i click the check box 1 then it will redirect to another page, when i click the check box 2 then it will redirect to another page.

How to make a code in HTML

Need Code Help

+2  A: 

First of all checkboxes are not supposed to be used for redirection purpose, however if you really want to do that, you can go about something like this:

var el = document.getElementById('checkbox1_id');
el.onclick = function(){
  document.location.href = 'somepage.html';
};

var el2 = document.getElementById('checkbox2_id');
el2.onclick = function(){
  document.location.href = 'somepage2.html';
};
Sarfraz
A: 

Radio buttons would be more appropriate. Can you explain the context?

Adam Beizsley-Pycroft