Please see the my test site here.
The script is written in the <head> so you will be able to see it there.
Instructions
If you click the blue area a new element will be made. Do this four or five times. Now click all the elements you’ve just created. They should all have a black outline. However, some do and some don’t.
Additional Info:
Only tested on chrome so far.
Any ideas on what’s going wrong here?
You are adding the click listener to all bubbles each time a new one is created.
Add the listener once with the live listener. It can be set before any of the bubbles are created.
And don’t use numeric
idattributes, it’s disallowed by HTML.Also, you are toggling the
activeclass — there’s a shorter function for this — toggleClass.