Yes, add onclick to span:
spanTag.onclick = function() {
this.innerHTML = '';
};
It just clears the contents span. I was not sure what you mean by erasure.
span, :
spanTag.onclick = function() {
this.parentNode.removeChild( this );
};
, :
spanTag.onclick = function() {
var el = this;
while( (el = el.parentNode) && el.nodeName.toLowerCase() !== 'tr' );
if( el )
el.parentNode.removeChild( el );
};
, :
spanTag.onclick = function() {
var el = this.parentNode;
while( el ) {
if( el.nodeName.toLowerCase() === 'tr' ) {
el.parentNode.removeChild( el );
break;
}
el = el.parentNode;
}
};