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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:18:43+00:00 2026-06-10T07:18:43+00:00

I am using the tabview , which is part of the YUI3 library. The

  • 0

I am using the tabview, which is part of the YUI3 library.

The markup basically looks like this:

<div id="demo" class="yui3-tabview-content">
  <ul class="yui3-tabview-list">
    <li class="yui3-tab yui3-widget yui3-tab-selected">
      <a href="#foo" class="yui3-tab-label yui3-tab-content" tabindex="0">foo</a>
    </li>
  </ul>
  <div class="yui3-tabview-panel">
    <div id="foo" class="yui3-tab-panel yui3-tab-panel-selected">
      <p>
        foo content
      </p>
    </div>
  </div>
</div>

A fiddle of the markup: http://jsfiddle.net/zb6su/

Problem: I am writing some javascript code and would like to select a tab given the tabview-panel. Let’s say I was able to get the id, foo, in this case. I would like to select the tab with a[href=#foo].

The problem is that a[href=#foo] does not work at all, because # is used to select Ids. I have also tried a[href="#foo"] to no avail. Is there a css selector to select a link based on a URL fragment in the href attribute?

I know that with javascript, I can iterate through all the nodes and check the href attribute, but I would prefer to use a CSS selector where possible.


Update: The selector does work. It looks like it’s a bug in FireFinder (an extension I am using to test the selectors).

  • 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-06-10T07:18:44+00:00Added an answer on June 10, 2026 at 7:18 am

    It works fine with the same selector, but using jQuery (fiddle).

    $('a[href="#foo"]').text();
    

    Returns "foo". Same with CSS:

    a[href="#foo"] {
        color:red;
    }
    

    It seems that the problem was more with F21’s FireFinder, not the usage of a[href="#foo"]. Case closed.

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

Sidebar

Related Questions

I'm using YUI3 TabView component, and I'd like to be able to get the
I am using tabview in my application, in which Home is default tab selected
using this http://bl.ocks.org/950642 we can see how to add images to nodes, the question
Using CI for the first time and i'm smashing my head with this seemingly
This question actually has two parts. The first part: I've been developing my first
Are there any restrictions on a UITextField when placed inside a tabview which not
I am using the grails ui component tabView. For each tab I am invoking
I cant find ANY examples of using the HorizontalTabTitleView class. Ive tried many things
I'm using the YUI TabView tab system. I want to be able to select
I would like to create a tab view just by hide and show div

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.