I have a click function that passes the following dom as this:
<span class="tcloud label label-large label-primary" data-c="1" data-n="environment">
environment
</span>
How can I use jquery to select for the values of the html5 data attributes?
$(document).ready(function() {
$('span.tcloud').click(
function () {
console.log(this) // returns the above dom
console.log($(this)) // returns an error
console.log(this.data("data-c")) // returns Uncaught TypeError: Object #<HTMLSpanElement> has no method 'data'