With this function:
function modifyJS(elemento){
if (document.getElementById(elemento).innerHTML.indexOf('✔')>0){
document.getElementById(elemento).innerHTML=document.getElementById(elemento).innerHTML.substring(0,document.getElementById(elemento).innerHTML.length-29);
}else{
document.getElementById(elemento).innerHTML=document.getElementById(elemento).innerHTML+'<b color="green">✔</b>';
}
}
I would like to modify the inherited HTML content. When I call the function the error is the following
TypeError: Cannot read property 'innerHTML' of nullangular.1.4.6.min.js:107
I breakpointed it, but the "elemento" variable passed to identify the HTML element is correctly given to the function.