itemsInCart = -1; if (itemsInCart > -1){ document.getElementById('cartView').innerHTML = "" + itemsInCart + " item(s) in cart | Checkout"; }else{ document.getElementById('cartView').innerHTML = "0 item(s) in cart | Checkout"; }