I am loading an element through jQuery AJAX
whose id is questionBeanPV.coAppQuestions150.answerText
I know the id is too long and it contains jQuery's '.'
but i cannot change the id.
I want a funnction to be called when this element is clicked. However the following code is not working.
$(document).ready(function(){
$('#questionBeanPV\\.coAppQuestions150\\.answerText').click(function(){
alert('Hello !');
});
});
I have observed that this doesnt work for any dynamically loaded element. What am i missing ? Is this the correct way or some other way is there?