How do I test if an object is inside another one using Jquery?
<p>Without using plug-ins, how would I check if an element is inside another? I tried using<br>
<code>element.hover();</code><br>
but to no avail. Is this possible with pure JQuery, or should I look for a workaround?</p>

<p>The code currently looks like</p>

<pre><code>$(document).ready(function(){  
    $(".element_to_drag").mousedown(function(){  
    $(this).addClass("dragging");   
    $(".dragging").live("mousemove", function(e) {  
        var offset = $("#container").offset();  
        var x = offset.left;  
        var y = offset.top;  
        $(this).css("position", "absolute");  
        $(this).css("left", e.pageX - x);  
        $(this).css("top", e.pageY - y);  
    })  
    $(".dragging").live("mouseup", function(e)  
    {  
        $(this).removeClass("dragging");  
    })  
    $("#elementContainer").hover(function()  
        {  
            $(".dragging").css("background-color", "red");  
        });  
    });  
});
</code></pre>

<p>I'm very much still learning, feel free to critique anything.</p>
