1

I want to get the text bold and underline and want to change some text to red color I am trying like the below code but still not changing anything

<script src="/../IT/SiteAssets/jquery.min.js"></script>
  <script type="text/javascript">
  $(function() {
   if($(this).html() == ("1.  This online survey is used to find out how many staff will be interested to attend the Onsite Health Screening"))
{
  ($(this)).html("Yes, I would like to attend the FREE Onsite Basic Health Screening at <U><B> JI Site Office on 16 August 2016 </B></U> (please proceed to Q2)");
}
});
</script>

1 Answer 1

1

You should use bold tag in html text see example below:

$(this).html("Yes, I would like to attend the FREE Onsite Basic Health Screening at  <b>JI Site Office on 16 August 2016 </b>  (please proceed to Q2)")
6
  • I tried like this only it dint reflect... is there any solution for this ?
    – sai
    Commented Jul 5, 2016 at 8:54
  • it should work, i have tried and tested it. What is this in your case, is that an element
    – Ravindra
    Commented Jul 5, 2016 at 9:19
  • $(this).css("color","red"); Commented Jul 5, 2016 at 11:29
  • Hi @AnkitKumar $(this).css("color","red"); this is not reflecting is there any method to approach
    – sai
    Commented Jul 7, 2016 at 1:38
  • I want to change only "please procced to Q2" to red
    – sai
    Commented Jul 7, 2016 at 1:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.