Consider a line such as this:
<div id='abc' onclick='DoSomething(this.id)'></div>
Now, suppose it's expanded to be something more like this:
<div id='abc' data-something='whatever' onclick='DoSomething(this.id)'></div>
There's no functional difference here yet, but this is my question. I'm looking for a way to pass the value of 'data-something' to the DoSomething function instead of the id. I can't seem to find a method of doing this? Is it possible?
Something like the following would be nice, but of course it's not how it works. (I'm only including it to help illustrate the intended goal.
<div id='abc' data-something='whatever' onclick='DoSomething(this.data-something)'></div>
'datasetand falls back togetAttribute: jsfiddle.net/C3rnr