Hi guys,
First of all thanks for reading this. I need a bit of help, my second reset button do not want to work.
here is a pen to check it out.
Thanks in advance for any advice
Hi guys,
First of all thanks for reading this. I need a bit of help, my second reset button do not want to work.
here is a pen to check it out.
Thanks in advance for any advice
Hello @Mikra .
You seem to have passed the wrong id while referencing the element in the resetCat()
function. The div you should reference has the id: flex-catgen
and not generateCat
I tried it out and it’s working perfectly.
I think he needs to give the images he is creating an id and target it. I don’t think we want to remove the containing div.
But since it can create more than one image, and ids must be unique, you’d have to give it a class or you’d have to select the children of the containing div.
Oh, yes. This would be the best solution. Remove the images instead of the whole div.
Hi @Mikra
@kevinSmith idea would be the best solution. Remove the images on reset instead of removing the whole div containing the images.
I’m not sure, that might work. Or null or something. There might be some function that empties out a node. I don’t do much vanilla DOM manipulation. I just thought you should only remove what you added.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.