cloned.insertAfter(thisRow).find('input:date').val('');
This line is incorrect. It throws an invalid selector error.
You need to change it to:
cloned.insertAfter(thisRow).find('input[type="date"]').val('');
jQuery actually supports :INPUT-TYPE format in selectors, but not new HTML5 input types (for now): so using input[type="date"] here is the right way to select an element with type HTML5. Pay attention to the quotes around the meaning. If you want to select an attribute with a specific value.
An overview of css selector selectors is here: W3schools .
Since this line throws an error, your newIDSuffix never updated, because the script stops in the line before that due to a script error.
@ Charlietfl raises the actual moment to learn more about classes and DOM traversal. However, this will not fix this code. Or explain why your code is not working. However, this is good advice.
source share