Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3306996
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:21:16+00:00 2026-05-17T21:21:16+00:00

I am using php. Create a file leftcolumn.php which includes following codes.. <!DOCTYPE html

  • 0

I am using php. Create a file leftcolumn.php which includes following codes..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="javascript">
    function setClass( tabName ){
        document.getElementById(tabName).style.background = '#f0f7fa';
        document.getElementById(tabName).style.color = '#c66653';
    }
</script>
</head>

<body>
<div id="sidebar">
    <img src="images/logo.png" />
    <ul class="sideNav">
        <!-- Use class="active" for selected tab -->
        <li><a id="dashboard" href="cms.php" onclick="setClass('dashboard');">Dashboard</a></li>
        <li><a id="mainMenu" href="menus.php">Main Menus</a></li>
        <li><a id="retailers" href="#">Retailers</a></li>
        <li><a id="productimages" href="productimages.php">Product Images</a></li>
        <li><a id="pressreleases" href="pressreleases.php">Press Releases</a></li>
        <li><a id="news" href="news.php">In the News</a></li>
    </ul>
    <!-- // .sideNav -->
    <br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</div>
</body>
</html>

Now, I just want to apply background = ‘#f0f7fa’ & color = ‘#c66653’ (on active tab) when user click on a tab, for this I created a function but it does not apply change…..!

Kindly help to solve it….

Thanks…..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:21:17+00:00Added an answer on May 17, 2026 at 9:21 pm

    Well, you code actually works, but can’t see it because of the redirect to cms.php. Try this:

    <li><a id="dashboard" href="#" onclick="setClass('dashboard');">Dashboard</a></li>
    

    If you want to do it another way, try something like this:

    <li><a id="dashboard" href="cms.php" <?php if ($page == 'cms.php') ?>class="active"<?php } ?>>Dashboard</a></li>
    

    and define the style in the header

    .active {
      background-color:#f0f7fa;
      color: #c66653;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could any one explain me how to create a text file using php where
I'm using PHP to create a CSV file from a database query. I run
I'm trying to create a CSV file using php. How can I print non
Using php, I'm trying to create a script which will search within a text
I'm using PHP to create maintainable stylesheets, as described in the following article: http://www.barelyfitz.com/projects/csscolor/
I'm using PHP to create some basic HTML. The tags are always the same,
I am using PHP's ZipArchive class to create a zip file containing photos and
I'm using a PHP script to stream a live video (i.e. a file which
im trying to create a xml file using php.everytime i run the code the
In PHP, i will write (create) the file using file_put_contents($filename, $data); It is ok,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.