I am calling function via ajax and I am getting the data properly, but I am not able to access the hidden elements in html returned.
Code:
success: function(data){
var $response = $(data);
var errorMessage = $response.filter('#errorMessage').val();
alert(errorMessage);
}
I am getting "undefined" alert. What's wrong?