+ 1
Event.dataTransfer.setData('text', event.target.id)
here I know that event.target.id gets u to id of the element which fires the event but why does we need the 'id' of element if we have to set innerHTML of the element as data to transfer it to some other element...what actually event.target.id does?
4 Antworten
+ 1
event.target.id points on the target point to transfer the data and we need it so we could execute the event on the right element
+ 1
if i'm not mistaken :)
+ 1
@toper664 bros ...after intense searching on web i got my answer ..thx ... but event.target indicates the element which fires the specific event like ondragstart, ondrop etc .. n here id is used to transfer it to the element with ondrop event .....
+ 1
hmmm so that it... thanks @pradeep kumar and sorry for the mistake