New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Setting Content Area Defaults in Html mode

HOW-TO

Set Content Area Defaults in Html mode

SOLUTION

The code below demonstrates how to get a reference to the TextArea element of RadEditor used in Html mode and set its background-color and color properties programmatically:

<script type="text/javascript">  
function OnClientLoad(editor)  
{          
    var area = editor.get_textArea(); //get reference to the textarea of RadEditor in Html mode  
    area.style.color = "red";  
    area.style.backgroundColor = "yellow";              
}  
</script> 

<telerik:RadEditor runat="server" 
    OnClientLoad="OnClientLoad" 
    ID="RadEditor1">  
</telerik:RadEditor> 
In this article