$(document.body).click(function(event) {
if(($(event.target).parent("div#tooltip").length > 0) || $
(event.target).is("div#tooltip")){
event.stopPropagation();
return false;
}...........
<div id="tooltip" style="display: block; top: 294px; left: 503px;"
class="modal"><h3>Quick Post</h3><p class="body">
<form method="post" action="profile.php">
<div>
<label for="title">Title:</label><input type="text"
name="blogTitle"/><br/>
<label for="blogText">Blog:</label>
<textarea name="blogText"/><br/>
<input type="submit" value="Write" name="submit[entryAdd]"
style="width: 37px;" class="form_but"/>
</div>
</form>
</p><p class="url"/><span class="close"/></div>
I have also found that if I use .parents instead it does work as it
should.
On Jul 13, 6:21 pm, "Dan G. Switzer, II" <[EMAIL PROTECTED]>
wrote:
> >I am having a problem with matching if the event.target is a form. I
> >have a div with several spans and a form in it, on the click event I
> >check event.target.parent("div#tooltip") if I click on any of the
> >spans this matches true as it should, but the form does not match it.
> >Is this know about? Can anyone suggest a workaournd?
>
> Do you have some sample code that illustrates the problem?
>
> -Dan