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 6689429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:31:05+00:00 2026-05-26T05:31:05+00:00

This seems so simply yet its not working (undefined). I have set a var

  • 0

This seems so simply yet its not working (undefined).

I have set a var to <ul> which is a child of <div> element “feature_tabs_indicators”.
The pBoxShadowProperty function gets the BoxShadow property supported by the current browser.

And the final statement merely sets the pBoxShadowProperty to 0, i.e. its overriding the CSS set Box-Shadow property.

Can someone please explain what I am doing wrong here in the last statement?

Best,

var iActiveNo = 0;
var eTabInd = document.getElementById ("feature_tabs_indicators").children[0];
var pBoxShadowProperty = getSupportedCSSproperty(["boxShadow", "mozBoxShadow", "webkitBoxShadow"]);

function getSupportedCSSproperty (propertyArray)
{
    var root = document.documentElement;
    for (var i = 0; i < propertyArray.length; i++)
    {
        if (typeof root.style[propertyArray[i]] === "string")
        {
            return propertyArray[i];
        }
    }
}

iActiveNo = iActiveNo + 1;
eTabInd.children[iActiveNo - 1].style[pBoxShadowProperty] = "";

Here is the jsfiddle, press the light green button ‘rght’ on top right.

  • 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-26T05:31:06+00:00Added an answer on May 26, 2026 at 5:31 am

    I think I figured out what your issue is. You use here:

    iActiveNo = iActiveNo + 1;
    

    something that has not been defined in your posted code. However you do have:

    var iActive = 0;
    

    which I think should have actually been:

    var iActiveNo = 0;
    

    otherwise your code has JS error in it (as it is posted, anyway).

    Other than that (that is, if your intention was to take the 1st <li> element out of the <ul> element and remove its box-shadow CSS property) – your code is just fine.

    Edit

    Dude, what a mess.. 🙂 Here is a JSFiddle I fixed up a bit. Below is the explanation.

    There are several things going on in that JSFiddle that should be fixed before we get to the real problem.

    You have errors in that fiddle – see console. The line:

    var pBackgroundColorProperty = eStyle.backgroundColor //[pBoxShadowProperty];
    

    doesn’t end with a semicolon, and is then interpreted as a function due to (..) on the next line (I think) – which (for me at least) results in an error in JS console. If semicolon is added – error is gone.

    Additionally… There is a line:

    console.log (eTabInd.children[iActiveNo-1].style.pBoxShadowProperty);

    which prints your undefined and is exactly what was discussed below and should be

    console.log (eTabInd.children[iActiveNo-1].style[pBoxShadowProperty]);
    

    which then prints the empty string.

    Moreover, when printed, your pBoxShadowProperty variable contains boxShadow string. Which is, of course, not a valid CSS property I am familiar with. So this:

    eTabInd.children[iActiveNo - 1].style[pBoxShadowProperty] = "";
    

    won’t do a thing.

    Now to the meat of the issue here…

    eTabInd.children[iActiveNo-1].style
    

    doesn’t have ‘box-shadow’ property to begin with, because you haven’t put it in style attribute of <li> element. It is put on the <li> element through the virtues of this CSS selectors sequence: #feature_tabs_indicators ul #ind_bt.

    Now, since you wanted the style attribute – you won’t get the computed style the above CSS selectors sequence applies. Thus – you won’t be able to remove it.

    What you could have done is create another class, that doesn’t have a box-shadow property and replace your original c_ind with it.

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

Sidebar

Related Questions

This seems like a simple problem: I have a WF4 activity that guides the
I have written this short script (which I've stripped away some minor detail for
This question seems to come up a bit and I've yet to see a
I seem to run into this situation quite a lot and have yet to
This seems simple but I can't figure it out. I receive post data in
This seems painfully simple, but I can't work out how to do it: I
This seems deceptively simple. How do you override the onclick event in the following
Warning - I am very new to NHibernate. I know this question seems simple
I'd like to count and group rows by specific values. This seems fairly simple,
This seems like a simple question, but I can't find it with the Stack

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.