PatrikA Posted September 22, 2004 Share Posted September 22, 2004 EDIT! Glöm mitt inlägg, eller låt det vara en påminnelse om att kolla ingenom sin kod innan Jag försöker förfriska minnet lite, jag förstår inte varför inte min metod vill fungera, obs att det är mycket test-kod nedanför men inget verkar fungera. // javascriptfunktion function showCountries(cID) { switch(cID) { case "northamerica": countries = "USA, Kanada"; continent = document.getElementById("showcountries"); continent.innerHTML = countries; break; case 'southamerica': break; case 'europe': break; case 'australia': break; case 'asia': break; } } //Stället jag använder funktionen på <table border="0" width="80%" cellpadding="0" cellspacing="0"> <tr> <td><div style="cursor:hand;" id="northamerica" onclick="showcountries.InnerHTML='test';">Nordamerika</div></td> <td><div style="cursor:hand;" id="southamerica" onclick="showCountries(this.id);">Sydamerika</div></td> <td><div style="cursor:hand;" id="europe" onclick="showCountries(this.id);">Europa</div></td> <td><div style="cursor:hand;" id="australia" onclick="showCountries(this.id);">Australien</div></td> <td><div style="cursor:hand;" id="asia" onclick="showCountries(this.id);4">Asien</div></td> </tr> <tr> <td colspan="5"<div id="showcountries"></div></td> </tr> <tr> <td colspan="5"><div id="showinfo"> </div></td> </tr> </table> [inlägget ändrat 2004-09-22 17:49:03 av Patrik Ahlberg] Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.