Jump to content

Recommended Posts

Posted
I want to change background color of a table in text area using the property defined. That is the property value will change at runtime. Everytime when the text area is refreshed it should have the latest background color for the table
Posted

var list1=["a","b","c"]

var list2=["d","e"]

 

var tableid= document.getElementById('tableid');

var name= document.getElementById('name'+).textContent;

if(list1.indexOf(String(name).trim())>-1)

{

if(tableid !=null)

{

tableid.style="color: ADFF2F; background-color:ADFF2F"

}

}

else if(list2.indexOf(String(name).trim())>-1)

{

if(tableid !=null)

{

tableid.style="color: #DAA520; background-color:#DAA520"

}

}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...