I have script in JS:
$("#mailstextarea").on("change keyup paste click", function(){
var text = this.value;
var rez = text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);
document.getElementById("emails").innerHTML = rez;
for(var i = 0; i < rez.length; i++){
addRow(rez[i]);
}
})
When in #mailstextarea I type text with mails, I see this mails in div #emails, but I get error on rez.length „Cannot read property 'length' of null”. Why? Thanks!
nullif there were no matches."