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

  • SEARCH
  • Home
  • 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 6668857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:05:11+00:00 2026-05-26T03:05:11+00:00

I have an ASP.Net Navigation Menu control with 1 item that I need to

  • 0

I have an ASP.Net Navigation Menu control with 1 item that I need to dynamically change the color of the text if certain conditions exist. I have a function set to run every 1 second to check for those conditions and needs to set the text of the menu item to Red if true. I’ve tried:

var item = $("ul").children().eq(6);
item.style.color = "red";

But get “cannot set property color of undefined” error. I’ve tried:

$("ul").children().eq(6).css("color", "red");

And it finds the menu item, changes the color property to red, but still displays the previous color. Never actually turns red. Below is the html from the page when this happens:

<li role="menuitem" class="static" style="position: relative; float: left; color: red; ">
    <a class="level1 static" href="Sync.aspx" tabindex="-1">Sync</a>
</li>

Any ideas?

  • 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-26T03:05:11+00:00Added an answer on May 26, 2026 at 3:05 am

    It’s because you’ve got an anchor tag <a> within the <li>. What you need to do is to set the color of the <a> not the color of the <li>:

    $("ul").children().eq(6).children().css("color", "red");
    

    Example: http://jsfiddle.net/Jscng/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC page that has left Menu Navigation that is built
I have an ASP.NET MVC Page that has Left Menu navigation that is built
I have an ASP.NET website, on the masterpage I have a basic navigation menu:
using ASP.NET MVC 2 I have a navigation menu inside my Master Page. In
I have developed an asp.net control that inherits from the gridview and its called
Ok I have an asp.net menu control which is created from codebehind. It works
I have integrated a Silverlight Navigation Application in an ASP.NET MVC web. However when
I have asp.net form that contains fields. When I access this window, my javascript
I have asp.net TextBox with ontextchanged event this is search text box in my
Background: I work in a suite of ASP.NET applications that have several different modules.

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.