snipesh0tz Posted May 18, 2010 Share Posted May 18, 2010 Hello, I have this little script on my website. What it does is when a user clicks on the Name it will show information, if they click again it will hide again. But now after a couple weeks a friend of mine told me it didn't work in IE8 and I only use Chrome and Firefox so I didn't know This is what on the page: <h2 style="cursor: pointer;" onclick="changeInfo_0()">Click here</h2> <p id="information0"></p> And this is the javascript link_0 = 0; function changeInfo_0() { if(link_0 == 0) { document.getElementById('information0').innerHTML = 'If you click this will come'; link_0 = 1; }else if(link_0 == 1){ document.getElementById('information0').innerHTML = ''; link_0 = 0;} }; Can anyone tell me how to get this working on IE? Quote Link to comment Share on other sites More sharing options...
wdallman Posted May 18, 2010 Share Posted May 18, 2010 Is 'information0' the id of a table? I'm only a newbie, but I just recently found that IE has a problem with .innerHTML when it deals with tables. I had to use the id in a div in order for it to work in IE. Quote Link to comment Share on other sites More sharing options...
snipesh0tz Posted May 19, 2010 Author Share Posted May 19, 2010 I use it on wordpress pages. I put the following in my page <h2 style="cursor: pointer;" onclick="changeInfo_0()">Click here</h2> <p id="information0"></p> And the other script in my header.php So afaik it doesn't deal with tables Quote Link to comment Share on other sites More sharing options...
snipesh0tz Posted May 21, 2010 Author Share Posted May 21, 2010 BUMP Hope bumping is allowed but it wasn't on the first page anymore, also if something like this is possible with AJAX or something else. Ty Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.