In my html I have a span element:
span
This is a
This works for me
$('.someclass').click(function() { $varName = $(this).data('fulltext'); console.log($varName); });