title: Onclick event on an imagemap area element
body: <p>I have the following problem. I have a big image (banner) and on it I have two flags which are 2 map areas. I want to do the following: when you click on English flag the language changes to English, when you click on Spanish flag, the language changes to Spanish. I don't know if I should do it with an href or onclick function. I add some code.</p>
  
  <pre><code>&lt;img src="banner_trading_1440_x_176_esp.jpg"   usemap="#planetmap"&gt;
  &lt;map name="planetmap"&gt;
   &lt;area shape="rect" coords="1318,14,1346,32" alt="Eng"  href="javascript:window.location.href='&lt;?php echo base_url(); ?&gt; LanguageSwitcher/switchLang/spanish';" &gt;
   &lt;area shape="rect" coords="1276,14,1303,32" alt="Esp" onclick="javascript:window.location.href='&lt;?php echo base_url(); ?&gt; LanguageSwitcher/switchLang/spanish';"/&gt;
  &lt;/map&gt;
  </code></pre>
  
  <p>Before I had both flags as 2 separate images and the code was like this (and it worked perfectly):</p>
  
  <pre><code>  &lt;img style="width: 30px; cursor: pointer; padding-top: 15px; padding-bottom: 15px;" src="http://www.hemptrading.com/tienda3/asserts/img/spain.png" onclick="javascript:window.location.href='&lt;?php echo base_url(); ?&gt; LanguageSwitcher/switchLang/spanish';"/&gt; 
  </code></pre>