You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 20, 2022. It is now read-only.
$('.new-line').on('click', function () {
var source = document.getElementById("row-template").innerHTML;
var template = Handlebars.compile(source);
var html = template();
$('.productcontainer').append(html);
});
Datepicker:
$('.date').datepicker({
format: 'dd.mm.yyyy'
});
HTML Handlebars template (the same code as rendered on page load):
So the datepicker is working great on the first row that in rendered on page load, but every new row that is created with JS does not work. I assume that it is because the DOM is changed and it does not pick up on that.
I assume you're trying to create an infinite record table for adding/updating multiple rows.
I'd recommend .clone or template literals for that matter.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi,
How can I attach the datepicker to input elements that have been dynamically inserted to the site?
The text was updated successfully, but these errors were encountered: