PDA

View Full Version : span links don't work in ie5?


ASAAKI
01-24-2003, 12:14 PM
I'm an absolute dunce at compatibility issues.

Here's a part of my code. It works in IE6 but not IE5. I tried using regular <a href> links with a javascript (a href="javascript:.....), but no good. or maybe i couldn't do it right.

this is the code:
<span style="cursor:hand" onclick="document.getElementById('rules').style.visibility='visible';">
Game Rules</span>

Any ideas?

meth
01-24-2003, 02:22 PM
JS is case sensitive, which I would take to mean - when I see <a href="Javascript:someFunction();">link</a> - I wouldn't use ....="javascript:someFunction();"......

Also, you have an onClick event handler in concert with span tags, something I'm sure would be awkward to say the least. Try giving the span tags an ID="blah", write a function to carry out your aim then find a way to use a link or image or even an onLoad, onBlur handler to call the function...

Terry
01-24-2003, 06:47 PM
Try this:

<a
href="javascript: void(0);"
onclick="javascript: document.getElementByID('rules').style.visibility='visible';">
Game Rules</a>

<p id="rules" style="visibility: hidden;">
GAME RULES<br / >
fkjljflkjfkldjf<br />
skdfhjhfjkhdfkjdhfk
</p>

- Terry