Within my ajax success function, I have the following code:
$('#searchButton').on('click',function(){
//ajax call
//within that ajax call's success function:
$.ajax({
type: 'POST',
url: 'search.php',
data: {x:x},
success:function(dataReturn){
$('#returnThree').html(
"<img id='expandThree' class='expandThree' src='../../img/expand.png'>"
);
I have another function that I want to be called when the user clicks on this image, but I can't figure out where to put the code as nothing seems to work:
$("#expandThree").click(function() {
console.log('hi');
});
I've tried putting it both inside and outside of the $('#searchButton').on('click',function(){
, but it's not calling. What am I doing wrong?