<input type="checkbox" onClick="getopn('http://davidwalsh.name')"> </body> <script type="text/javascript"> function getopn(loc){ alert("comr"); window.location = loc; } </script>