clone and change
clone and change
Is there a problem with trying to fire a .change() on a cloned item? It's not working and I can't figure out why.
- $("#Category").change(function(e) {
- var question_set = this.value;
- var replace_set = $("#question" + question_set);
- // reset box
- $("#question_box").html("");
- $(replace_set).clone().appendTo("#question_box");
- $("#question_box div").attr('id', 'question_set');
- $("#question_box select").attr('id', 'question_one');
- $("#question_set").removeClass('question_hidden');
- e.preventDefault();
- });
- // This is the part that doesn't work. The correct select is there with the correct
- // correct id=question_one but when I change the select box the alert doesn't fire.
- $("#question_one").change(function(e) {
- var selected_question = this.value;
- alert("selected_question: " + selected_question);
- e.preventDefault();
- });
Any help on this one?