How can I get a php variable inside javascript click()? My click() code is
$(".sample_icons").click(function(){
var $srcimg=$(this).children("img").attr('src');
image_icon($srcimg);
});
I have a variable $price
in a php file and i want something to happen to this variable say increase price when this click()
is used. Click()
is in a js file. So how can I pass this variable to js file so that it can be used under click()
?