1
簡單的問題,我真的不知道如何解決,我怎樣才能讓.text(totalweight)
顯示爲粗體?如何以粗體顯示此jquery
下面是代碼:
$("#total-weight").text(totalweight).append('%');
感謝
簡單的問題,我真的不知道如何解決,我怎樣才能讓.text(totalweight)
顯示爲粗體?如何以粗體顯示此jquery
下面是代碼:
$("#total-weight").text(totalweight).append('%');
感謝
這應該爲你做的伎倆:
$("#total-weight").text(totalweight).append('%').css('font-weight', '700');
正如Moak所示,您可以使用bold
作爲字體重量的值,但使用數字可以提供更精確的控制。 w3schools has more information,並解釋了爲什麼我使用了700的價值。
$("#total-weight").css({fontWeight:'bold'}).text(totalweight).append('%');
只是數量:
$("#total-weight").html('<b>'+totalweight+'</b>').append('%');
謝謝你的回答 – BruceyBandit 2012-01-06 03:11:09