I have a div
and some images, each image represents an item in a global array . When I drag this image to% editing% an editing form is enabled, otherwise a form is enabled to create new rule and generate a new image.
I need to know when there is an image in div
to enable inclusion or editing mode and for this I need to know the ID of it since it is the array index.
if(document.getElementById("manage").innerHTML == ""){
console.log("vazio");
else{
var id = document.getElementById("manage").innerHTML;
console.log(id.attr("id"));
}
As "id" is a string with the content:
img id="ico-3" class="img-drag" src="images/isp.jpg" draggable="true" ondragstart="drag(event)"
In this example of IMG, the index in the array is 3.