My question concerns cloning and cloning events.
I have this button:
<button type="button" class="btn btn-inverse test">test</button>
In my JS:
//create a clone of my button at the start so any later changes to the btn do not effect future clones
var test = $(".test").clone(true);
$(".test").click(function() {
alert('a');
});
test.clone(true).insertBefore('#addQuestion');
The above clones the button but the event no longer works, where am I going wrong?