JS:
document.getElementById('x').onclick=function() {alert(this.title);}
Error log:
HTML:
test