Reputation: 3209
I am trying to get the value of my data-text from my twitter share button, I came up with this code:
var twitterTitle = $('.twitter-share-button').attr("data-text");
alert(twitterTitle);
but it was alerts undefined. Any ideas?
Upvotes: 0
Views: 106
Reputation: 165
should be
var twitterTitle = $('.twitter-share-button').data("text");
Upvotes: 1