I have something like this:
if (result.Indicator == 1) { $('#IndicatorImgDiv').append($('<img />').attr("src", "/Content/images/reddot.png")); }
Now it adds a red dot image when I click on the button, but when I click on the button again, it adds it again. I just want it to appear once when I press the button. How to check if an added item exists or not?
javascript jquery html
Kala j
source share