I have this in my js code:
window.onload = function()
{
document.getElementById('change_user').addEventListener("click", function()
{
getUserData(document.getElementById('change_user').getAttribute('data-user'));
}, false);
}
It works the first time I click the element, but when the element is replaced by the new HTML code, clicking it no longer does anything.
What's wrong?