SyntaxFix
Write A Post
Hire A Developer
Questions
Try this instead of your code:
var type=$("#the-span").attr("data-type"); alert(type);