Is there a way to conceal an HTML field if it displays a value of "0"? I manage an e-commerce site that shows the Quantity available with numeric values. I only want the number to be visible if it is greater than "0". The values are pulled from a database upload to the site. The "0" value is not part of an input field, so most of the codes I have come across offer solutions involving some sort of input condition code.
<span id="availability" class="product_availability availability-item"><p style="color: crimson; display: contents">Call for Availability. </p></span>
<span style="display: inline;" id="product_inventory">0</span>
Currently, my site shows this: Call for Availability.0 If the item has a quantity above "0", it will display: Qty On Hand: 1708 I am looking to remove the "0" and only show Call for Availability.
I have looked into similar requests on this forum and found that all responses involve using an input field. However, the issue lies in the fact that the "0" is not associated with an input field but rather generated as inventory amount within the code.
I attempted using CSS to hide the value, but this ended up hiding all values, even those above "0".
I am open to incorporating any type of code necessary such as Java, PHP, JSON, etc...