jQuery Click event on object added with JavaScript not working.
Posted
by Hultner
on Stack Overflow
See other posts from Stack Overflow
or by Hultner
Published on 2010-04-14T18:42:57Z
Indexed on
2010/04/14
18:53 UTC
Read the original article
Hit count: 244
I'm work on a quiz for school but I've bumped into a problem. I got a javascript file for custom radio buttons (CUSTOM FORM ELEMNTS by Ryan Fait if it's helping). The script hides the input buttons and adds custom styled spans instead.
Now what I want, when I click one of these JavaScript added spans I want to remove disabled for a button called "Next Question" which when pressed takes you to the next question. The reason for this is that I don't want people to accidently got to the next question without choosing a answer. The problem is when I press the added spans nothing happens but when I press another identical span which I have added in the html it works just as intended.
The span got the class radio which is the class I'm looking for in the jQuery.
Here's the test page with the error on: http://hultner.se/graphicsquiz/livetest/livetest.php
Short: Can't get jQuery .click() functions to work with spans added using JavaScript earlier in the document.
© Stack Overflow or respective owner