In my app when user clicks on button, browser creates new object. For instance:
$("#div1 svg").append("<ellipse id='#obj0' class='svgobjects'>");
It works. It appears in Chrome development tools. Then I want to set size of my ellipse using some data.
if (!$(ID).length > 0) {
console.log("Div doesn't exist");
} else {
console.log("I found it");
}
$(ID).attr("cx", data["startX"]).attr("cy", data["startY"]).attr("rx", this.rx).attr("ry", this.ry).attr("fill", data["color"]);
All of these variables are OK. All of them contains correct data. But in console appears: "Div doesn't exist".
The problem is: this div IS there and have the same id as "ID" variable ("#obj0"). But in spite of all jquery sais that div doesn't exist.