Maybe someone can figure this out because I sure have been having problems with it. I am looking to have a javascript that can be included a page that can highlight or set a border for a the div, p, span, or img DOM element when clicked on. Now this element may or not have a element name or id. And also, the code on the individual objects do not have a onmousedown behavior.
Lets say for example there is this code.
<div class="HeaderLogo">
<div class="logo">Copyright © <?php echo date('Y'); ?> My Website All Rights Reserved.<br />
<img src="../images/template_2/website-logo.png" alt="MY Website - CMS" width="413" height="51" />
</div>
</div>
<div class="CenterWidth">
<div class="TopMainNav">
<p>My First Sentence Text</p>
<p>jhdasfhjklas</p>
</div>
<div class="ContentArea">Text</div>
<br style="clear:both;" />
</div>
And in the browser, I wanted mousedown on a section of a page and highlight the parent object. Suppose I moused-down on 'My First Sentence Text', its parent would be that p tag. Is there a way I could reference that p tag so that I could highlight it with a border. Granted, this would be a no brainer if that p tag already have an id and name, but in this it does not. Does anyone have any ideas on this?
Thanks In Advance!