AJAX HElp

Discussion in 'JavaScript and AJAX' started by dj_buddhika, Feb 23, 2008.

  1. dj_buddhika

    dj_buddhika New Member

    Joined:
    Dec 7, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    document.getElementById("div_id_naMr").innerHTML="hello"; will display the hello text in the web browser . i just want to diplay the hello in the web browser in the red color . How to color up the text with ajax

    i want to keep the color in the javascript file
     
  2. Ami Desai

    Ami Desai Member

    Joined:
    Jan 5, 2017
    Messages:
    42
    Likes Received:
    17
    Trophy Points:
    8
    Location:
    Ahmedabad
    Home Page:
    http://www.ifourtechnolab.com/
    Hi,

    You can check this
    Code:
    var elem = document.getElementById("div_id_naMr");
    elem.innerHTML = "hello";
    elem.style.color = "Red";
    Thanks
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice