How do I pass a custom attribute to a function?

Viewed 7367
<select data-myattr="123" id="cboTest" 
        onchange="SayHello(this.data-myattr)">

This doesn't work. If I take the data-off of it it, it works, but from what I've read, it is html5 safe to do it that way. However, doing it that way, I get: "Microsoft JScript runtime error: 'myattr' is undefined".

This is my super-complex function:

function SayHello(msg) {
    alert(msg);
}

Thanks in advance.

3 Answers
Related