Skip to main content
Participating Frequently
November 16, 2016
Answered

Help bolding certain variables within text

  • November 16, 2016
  • 2 replies
  • 1284 views

I have certain input fields within my text that I want bolded and need help!

Here is the segment of my javascript code for my HTML5 canvas document that I need help with:

this.savings.text = "If you saved <b>" + investInput + "%</b> for retirement, only about <b>$" + weeklyDeduct + "</b> would come out of your weekly pay.";

I want " + investInput + " and " + weeklyDeduct + " bolded but the <b> tag does not work and shows up in the actual text instead.

Any suggestions?

This topic has been closed for replies.
Correct answer kglad

easeljs/canvas doens't support html text. 

you can add html text by editing your published files and adding html text above your canvas.

2 replies

EmbussyBus
Participating Frequently
June 6, 2017

Hi, I'm also trying to make imported xml text bold in Canvas
Did you find the solution and if so how did you do it?
I don't understand how you add html text above the canvas

Legend
June 7, 2017

Create a DIV layer above the canvas, then stuff HTML text into it. Helper functions here:

Re: How can I add video

EmbussyBus
Participating Frequently
June 7, 2017

Hi ClayUUID

Thank you for your reply, I'm still in early learning stages with Animate and Canvas, I tried using the 'add video' example but I just get a blank screen when testing.
Would you have a look and show me how to do it please? http://www.baselinegraphics.com.au/testXML.zip

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
November 16, 2016

easeljs/canvas doens't support html text. 

you can add html text by editing your published files and adding html text above your canvas.