Advertisement
Guest User

Untitled

a guest
Sep 6th, 2015
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var text = $('.stars').text();
  2. var newText = text.replace(/[^\d\+]/g, '<i class="fa fa-star"></i>');
  3. $('.stars').html(newText);
  4.  
  5. var text = $('.stars').html(); // Använder jag html() här så får jag en error att replace() är undefined
  6. var newText = text.replace(/[^\d\+]/g, '<i class="fa fa-star"></i>');
  7. $('.stars').html(newText);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement