0

Im displaying a message on a webpage in this format "5 pencils will be given to 6 students".

"span style="" data-bind="text: app.summary()"/span" 

Knock out databind is used here. summary() is a js method which returns me this message in the format defined in message.js file as "{0} pencils will be given to {1} students" but i need to display only the numbers as bold in the final HTML page.

I.e.5 pencils will be given to 6 students. I don't want to create individual span and split the string message.

Is there any way to do that?

Thanks

1 Answer 1

3
"<strong>{0}</strong> pencils will be given to <strong>{1}</strong> students" 
Sign up to request clarification or add additional context in comments.

1 Comment

This is ugly, but this is the only way without using HTML or Javascript to split the string in different parts. But it's very ugly to mix content and style :S

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.