Take the 2-minute tour ×

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

share|improve this question
It sounds like wildly unintuitive behavior, given how checkboxes normally work, and what the user will be expecting. –  wrosecrans Jul 7 '10 at 8:53
you'll need to use some client side script such as JavaScript to achieve this. This can't be done in HTML alone. –  Matt Ellen Jul 7 '10 at 9:00
Radio buttons would be more appropriate. Can you explain the context? –  Adam Beizsley-Pycroft Jul 7 '10 at 9:05

1 Answer 1

up vote 2 down vote accepted

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';
share|improve this answer

Your Answer


