I have a div with id=”add-dependent” including 2 rows and a button (add dependent) inside of the div. When “add dependent” button is clicked, the first row would be cloned and insert before (add dependent) button. Actually I have another button outside of the div called (add applicant) and by clicking it, whole of the div would be cloned and
Tag: clonenode
Property ‘id’ does not exist on type ‘Node’ in plain JS after cloneNode
I’ve got a pure JS function that adds a message to the page based on a chunk of “template” HTML. VS code is complaining about clone.id and clone.classList as a Node cannot have those properties. Now every answer and tutorial I’ve seen about cloning a chunk of HTML like this basically says to do exactly what I’m doing. I can