S
skultetc
Hey all,
I have a div displayed as a block with an onclick event that shows/
hides a different div underneath it. There is a link within the first
div that takes the user to a different page. My problem is that if the
user clicks the link, the onclick is also executed and the div
underneath is shown/hidden before the browser changes pages, which
makes things a little clunky looking. Is there any way to keep the
div's onclick from firing when the link is clicked? Here is some
example source of what I'm talking about:
<div style="display: block; width: 200px;" onclick="show_hide
('div2');">Some text with a <a href="otherpage.htm">link</a></div>
<div id="div2">Some other text</div>
I have a div displayed as a block with an onclick event that shows/
hides a different div underneath it. There is a link within the first
div that takes the user to a different page. My problem is that if the
user clicks the link, the onclick is also executed and the div
underneath is shown/hidden before the browser changes pages, which
makes things a little clunky looking. Is there any way to keep the
div's onclick from firing when the link is clicked? Here is some
example source of what I'm talking about:
<div style="display: block; width: 200px;" onclick="show_hide
('div2');">Some text with a <a href="otherpage.htm">link</a></div>
<div id="div2">Some other text</div>