How do I get the id value of the header into the alert in the next example:

HTML Code:
<!DOCTYPE html>
function showID() {
    //return this; doesn't work
    ID = this.id;
    alert ('ID is: ' + ID);
<h6 id="header" onclick="showID()">Header</h6>
I'm now getting 'undefined' as result. I can put the function inline, as in onclick="alert('ID is: ' + this.id)", but I need it to work the other way.

Thanx in advance.