Hi,

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

HTML Code:
<!DOCTYPE html>
<head>
<script>
function showID() {
    //return this; doesn't work
    ID = this.id;
    alert ('ID is: ' + ID);
}
</script>
</head>
<body>
<h6 id="header" onclick="showID()">Header</h6>
</body>
</html>
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.