C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Change the Background Colour of a Cell using Javascript


Posted Date: 19 Jun 2008    Resource Type: Code Snippets    Category: Javascript

Posted By: Subodh kumar Prajapati       Member Level: Gold
Rating:     Points: 2



Sometimes there may arise a need to change a particular cell's background color. For example, you may want to highlight some particular cell of table, say the "total amount" at the end of the table.

The client-side script in Javascript to highlight a particular cell is given below:


function dt()
{
document.getElementById("tt").style.backgroundColor="yellow";
}


The html page should be appropriately changed. So set the id of the td tag as follows:


<td id="tt">


Now call this javascript function on some event, say button click:


onclick="javascript:dt()



Attachments

  • See Attatched file (18957-20126-test.html)



  • Responses


    No responses found. Be the first to respond and make money from revenue sharing program.

    Feedbacks      
    Popular Tags   What are tags ?   Search Tags  
    Change background colour  .  Change background color using javascript  .  Change background color of a cell  .  Change background color  .  

    Post Feedback


    This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
    You must Sign In to post a response.
    Next Resource: How to Find Control Location Using JavaScript
    Previous Resource: Popup Boxes in Javascript
    Return to Discussion Resource Index
    Post New Resource
    Category: Javascript


    Post resources and earn money!
     
    Related Resources



    dotNet Slackers   BizTalk Adaptors    Web Design

    internet fax

    Contact Us    Privacy Policy    Terms Of Use