0

I need to make all site clickable. I tried to make ahref before content div but it works only in Firefox&Chrome not in IE. So I made site as a clickable table like this:

 <table onclick="window.location='http://google.pl'" id="Table_01"> ...here goes content...

It's working in Chrome, FireFox and IE ....but... I am wondering if it is right method and it will be working on every computer?

Tony
  • 77
  • 1
  • 1
  • 9

1 Answers1

1

According html5 spec, you can use link tag outside a block tag like table:

<a href="http://google.pl">
    <table></table>
</a>

Dont forget to apply display: block to link.

If you dont want to use link tag, you should write your script on js file and not usinf onclick property using id for example:

<table id="Table_01">

js:

function redirect() {
    window.location = 'http://google.pl';
}
document.getElementById("Table_01").onclick = redirect;
Pik_at
  • 1,459
  • 9
  • 14