Hi, so where is the actual problem?
Jan 3, 2023
3
Level 1
put acondition to not let you to pur a higher number
Hi guys and Happy new year to all! i need some help and maby is someone here who can help me. I want to integrate an upper limit in this counter, the limit to be given by a condition here is the counter: $(document).on('click', '.limit_item_plus', function(){ var input = $(this).parent().find('input'); var num = parseInt(input.val()); input.val(num+1); }) and i need to add something like this:
if ((parseInt(this.adults) + parseInt(this.children)) >= max_guests) { alert('exceeding guests'); return;
Please or to participate in this conversation.