Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
135
Change the background
posted

Hi,

How to change the background of igTextEditor control in JavaSript?

I take the background value from the database, and cannot be fixed (stored in css).

Thanks,

Dusan.

Parents
No Data
Reply
  • 3115
    Verified Answer
    Offline posted

    Hi Dusan,

    You can use field method of the editor which gives you jQuery reference to the edit field and then apply your background.

    Here is a simple example

     

    Code Snippet
    1. <body>
    2. <div id="editors">
    3. <input type=button id="buto" value="click"/>
    4. <!-- Editors can also be created from DIV elements -->
    5.  <p><input id="textEditor" value="John" /></p>
    6. </div>
    7. <script type="text/javascript">
    8.  $(window).load(function () {
    9.  $("#textEditor").igTextEditor();
    10.  $("#buto").click(function () {

    var ed = $("#textEditor").igTextEditor("field");

    ed.css("background-color", "red");

    1.  });
    2.  });

     

     

     

    Thanks,
Children