What are the div tag events in jQuery ? I need to calculate the length of the div for that i wrote these code .
function drop(ev)
{
ev.preventDefault();
var data=ev.dataTransfer.getData("Text");
ev.target.appendChild(document.getElementById(data).cloneNode(true));
var n = $( "#div2" ).length;
alert(n);
}
But every time it showing answer as one . when ever i drop more images it must specify the how many images are in div . Will u help me wwhat event i have to write to get this answer .
when ever i drop more images it must specify the how many images are in div
I believe you're looking for
var n = $( "#div2 img" ).length;
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments