Advertisement
Guest User

Untitled

a guest
Nov 1st, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <span class="field" data-fullText="This is a span element">This is a</span>
  2.  
  3. $('.field').hover(function () {
  4. console.log('using prop(): ' + $(this).prop('data-fullText'));
  5. console.log('using data(): ' + $(this).data('fullText'));
  6. });
  7.  
  8. $(this).attr('data-fullText')
  9.  
  10. data-fulltext="This is a span element"
  11.  
  12. $(this).data('fulltext')
  13.  
  14. $('.field').hover(function () {
  15. var value=$(this).attr('data-fullText');
  16. $(this).html(value);
  17. });
  18.  
  19. $('.field').hover(function () {
  20. var value=$(this).data('fulltext');
  21. $(this).html(value);
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement