Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to set the font color for the field Label

NeilGove1
Contributor III

I am unable to change the font color of a field's label. 

In my custom object, I have a reference to the SPAN element (var myElement) which contains field label text.

I validated this by dumping its text and HTML to the console.log.  

My code uses the following js which is in the Sys.Application.add_load(function

myElement.style.color = 'red';

No errors occur but the text is still black.

We're running R6.8 P4 HF2 (6.8.00402.1001).

Any help on how to properly set the font color of a field's label would be appreciated.

10 REPLIES 10

@Pavan_2835 based on what @Ilya_Khen posted above; you have the syntax wrong.  It should be,

<script>
	$('#loitem47173').attr('style', 'color: #4169E1 !important');
</script>

 Advisory Consultant