This is my password validation code but it is only working for the first row. Can anyone help me to make it work on all rows including the newly added row?
var password = document.getElementById("password")
confirm_password = document.getElementById("confirm_password");
function validatePassword() {
if (password.value != confirm_password.value) {
document.getElementById("confirm_password").style.backgroundColor = 'red';
} else {
document.getElementById("confirm_password").style.backgroundColor = 'green';
}
}