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