Monday, 15 April 2013

Javascript (if var contains a word, change that word colour ONLY) -


In fact, an idea behind this is associated with a variable (a SQL server) from the program code, and the column is a VAARA

This code is trying to implement IM which changes the whole string to Blue, because it has the word 'if':

  If (contentItem.screen.SoftwareLibrary.Code.indexOf (if)! == 1) {element.style.color = "blue"; }  

What I would like to do is scan this variable through the code, and in it the word 'if' is, I want to make that word only blue.

Is this possible? And thankyou for any hint or help

If you highlight. You do not want to go Js route, you can use something like the following:

  contentItem.screen.SoftwareLibrary.Code.replace ("If", " 

I highlight. I highly advise to use JS, although it is very strong and will save a lot of time.


No comments:

Post a Comment