在javascript中获取php变量click()?

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()?

</div>

Put this into wherever you need the php variable to be.

<?php echo $price ?>

I make use of a hidden input:

<input type="hidden" id="this_price" value="<?php echo $price ?>">

$(".sample_icons").click(function(){
    var this_price = $('#this_price').val();
    var $srcimg=$(this).children("img").attr('src');
    image_icon($srcimg);
});