Multiple products per page. I want to display message based on quantity.
$j(document).ready(function () {
$j('#stockqty').text((parseInt($j('#stockqty').text()) > 0) ? "In Stock" : "Out of Stock");
});
I've tried this:
$j(document).ready(function () {
$j('#stockqty').each(function () {.text((parseInt($j('#stockqty').text()) > 0) ? "In Stock" : "Out of Stock");
});
});
Just not working.
.textin your.eachcallback needs to be called on something.$j('#stockqty').each?? Duplicating the id?$("#someid").eachdoesn't make sense, there can be only one$("#someid")$('#stockqty')will only return one element. What are you trying to do?