Open philsinatra opened 6 years ago
This was the most helpful help ever given! Thank you so much for these three thorough responses. With these, I was able to fix all my problems, and you seemed to anticipate and hint at problems I was going to have, and I got those too. This was everything I needed! You rock 🎯
Run the
submitHandler
the first time, your HTML updates as follows:Run the
submitHandler
a second time, your HTML updates as follows:Instead of updating the content within the original
#pic
,#title
and#desc
elements, you are creating a second instance of each of these elements. There are now two elements on the page that have the sameid
s. When you run thesubmitHandler
a third time:There are now three instances of all of these
id
s. When you runcloseWindow
, your script is clearing the values for#pic
,#title
and#desc
, but it's only able to do it for the first instance of each of these elements. The others are not cleaned, which is why the content is overlapping.You need to fix your script so there is only one instance of the
#pic
,#title
and#desc
elements. Each time you show a different princess, you should be editing the content within these containers, not creating new instances of each.