<div id="test" onclick="getId()">Help</div>
var elements = document.querySelectorAll('.click');
for ( var index = 0; index < elements.length; index++ ) {
elements[index].addEventListener( 'click', function() {
var id = this.id;
console.log( id );
} )
}