Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- Determine();
- });
- //Determine which products are still in stock and hide them
- function Determine() {
- var id1,
- id2,
- sum = 0;
- $("td.ProductID1").each(function(){
- id1 = parseInt($(this).text());
- sum = 0;
- $("td.ProductID2").each(function(){
- id2 = parseInt($(this).text());
- if(id1 == id2){
- sum += parseInt($(this).closest('tr').children('td:nth-child(2)').text());
- }
- }
- );
- if(sum >= parseInt($(this).closest('tr').children('td:nth-child(5)').text())){
- $(this).closest('tr').hide();
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement