Div tag events in jquery

Bhargavi

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 .

bfavaretto

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Div tag events in jquery

From Dev

Print a DIV tag in JQuery

From Dev

jQuery events to new created div

From Dev

Jquery clone div breaking events

From Dev

append inside div tag Jquery

From Dev

jQuery click div inside a tag

From Dev

How to assign two separate events to a div tag on click

From Dev

Navigate to page that is inside div tag in JQuery Mobile

From Dev

.css jquery attribute not applying css to div tag

From Dev

Creating a div using jquery with style tag

From Dev

wordpress jQuery pagination with div tag id

From Dev

adding a hover effect on a div tag using jquery

From Dev

JQuery append a div start tag only

From Dev

jQuery - filter a div based on anchor tag (click)

From Dev

hide div tag where id with jquery and mvc

From Dev

Finding a div tag by attribute using jQuery

From Dev

wordpress jQuery pagination with div tag id

From Dev

Load content in div from a href tag in jQuery

From Dev

Div tag centering isn't working with jQuery

From Dev

Find words and replace with tag wihtin div jQuery

From Dev

How to use jquery to surround the contents of every <div> tag with a <marquee> tag

From Dev

jQuery change text nested in div, paragraph tag and strong tag

From Dev

jquery emptying parent div does not delete events why

From Dev

jquery emptying parent div does not delete events why

From Dev

Events inside events at jQuery

From Dev

Add events to tag in Datatables

From Dev

Create a general javascript or jquery to make a div or tag set focus on first input inside of it when the div or tag clicked

From Dev

Jquery "the event object" trying to change "CSS" of <div> tag not working

From Dev

How to make background color of div tag keep changing using JQuery?

Related Related

HotTag

Archive