使用现有的javascript来触发if中的其他内容

I have the following script within a page on my site which adds + - buttons to a qty entry field:

<script language="javascript">
jQuery.noConflict();
jQuery(document).ready(function() {          
var $cartAdd = jQuery('#cartAdd')
  , $quantity = $cartAdd.find('input');   
$cartAdd.append('<div class="inc button">+</div><div class="dec button">-</div>');
jQuery(".back").change(function(){
     $quantity.val(1).change();
});

$cartAdd.click(function(evt) {
  var $incrementor = jQuery(evt.target)
    , quantity = parseInt($quantity.val(), 10);

  if($incrementor.hasClass('inc')) {
    quantity += 1;
  } else if($incrementor.hasClass('dec')) {
    quantity += -1;
  }

  if(quantity > 0) {
    $quantity.val(quantity);
    xhr.getPrice();
  }

 jQuery(".back").change(function(){
  xhr.getPrice();
});
});
});
</script>

I want to be able to hide/unhide a div when var $cartAdd goes above 1 I tried using something like

var $cartAdd = jQuery('#cartAdd')
  , $quantity = $cartAdd.find('input');
<?php $trigger = "<script>document.write(quantity)</script>"?>   

followed by

<?php echo $trigger;?>

and i expected that to echo the value in the entry box but it didn't.

Is it achievable?

You must understand that all php scripts are executed BEFORE the javascript.

What's wrong with simply grabbing the quantity and hiding if needed?

if( $('#cartAdd').find('input').val() > 1 ) 
{ $('#div_we_want_to_hide').hide() }

just put that inside a document.ready and it should work fine