Reputation: 4324
Simple question which I cannot actually figure out how to solve, how can I make .text(totalweight)
to be displayed as bold?
Below is the code:
$("#total-weight").text(totalweight).append('%');
Thanks
Upvotes: 1
Views: 1293
Reputation: 8255
This should do the trick for you:
$("#total-weight").text(totalweight).append('%').css('font-weight', '700');
As Moak has also shown, you can use bold
as the value for font-weight, though using a number offers more precise control. w3schools has more information, and explains why I used 700 for the value.
Upvotes: 1
Reputation: 12865
$("#total-weight").css({fontWeight:'bold'}).text(totalweight).append('%');
for just the number:
$("#total-weight").html('<b>'+totalweight+'</b>').append('%');
Upvotes: 2