var x = document.getElementById('container');
//click can also be antother event
x.addEventListener('click', function (x) {
console.log('hi');
});
$('.btn').click(function() {
$('[title=selected]').removeAttr("title");
$(this).attr("title", "selected");
});