Hi,
I have this:
Basically, I would like the "a" click to do something different than the "div" click, but when I use the code above, it keeps "assuming" the "a" is part of the "div" and exectues the "divClick"
I was thinking about posting this in the Javascript forum, but I think it has something to do with how my CSS is structured...
Help?
--------
GOOGLE is a great resource to find answers to questions like "how do i..."
--------
I have this:
Code:
<style type="text/css" media="screen">
.myDivClass {
width: 500px;
height: 100px;
border: 1px solid #000;
}
#divClick, #aClick { display:none; }
</style>
<script type="text/javascript" langugage="javascript">
// assume jquery-1.4.4 is already loaded
$(document).ready(function(){
$(".myDivClass").click(function(){
#("#divClick").css("display","block");
#("#aClick").css("display","none");
});
$(".lnk").click(function(){
#("#divClick").css("display","none");
#("#aClick").css("display","block");
});
});
</script>
<div class="myDivClass">
<p>Some Text</p>
<a class="lnk" href="somepage">A Link</a>
</div>
<div id="divClick">"div" was licked</div>
<div id="aClick">"a" was clicked</div>
Basically, I would like the "a" click to do something different than the "div" click, but when I use the code above, it keeps "assuming" the "a" is part of the "div" and exectues the "divClick"
I was thinking about posting this in the Javascript forum, but I think it has something to do with how my CSS is structured...
Help?
--------
GOOGLE is a great resource to find answers to questions like "how do i..."
--------