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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:57:34+00:00 2026-05-27T07:57:34+00:00

I want a selector like $(.author) that will select an element if author is

  • 0

I want a selector like $(".author") that will select an element if “author” is the value of any attribute, not just class.

E.g. selector.text() should give “Emily Ekins” for each of the following pages:

<a href="http://reason.com/people/emily-ekins" rel="author">Emily Ekins</a>

or

<bloop href="http://reason.com/people/emily-ekins" id="author">Emily Ekins</a>

or

<blah href="http://reason.com/people/emily-ekins" class="author">Emily Ekins</a>

or

<tag href="http://reason.com/people/emily-ekins" random="author">Emily Ekins</a>

Is there any way to do this?

  • 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-27T07:57:35+00:00Added an answer on May 27, 2026 at 7:57 am
    var elements = document.getElementsByTagName("*");
    for(var i=0;i<elements.length;i++){
        var element = elements[i];
        var attr = element.attributes;
        for(var j=0;j<attr.length;j++){
            if(attr[j].nodeValue == 'author'){
                element.style.backgroundColor='red';
            }
        }
    }
    

    Example

    Whew! That took some time. But this will check every single attribute of any given element, and if any attribute is author, it will change the background color to red.

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

Sidebar

Related Questions

Is there any way to get the text of the selector that invoked some
I want to invoke a selector of a method that has the usual NSError**
I want to take an ExtJS element(div) retrieved from the DOM selector, and convert
I want to target an HTML element when BOTH the id and class selectors
I wrote selector like this jQuery(td:contains('test')).parent(tr).find(a) I want to click link in table. It
I want something like: var user_name = $(.hidden_user_name).text(); $(a[name=+ user_name +]).doStuff()... This works: $(a[name=joe123]).doStuff()...
i want to get back an array of all: hidden inputs text inputs select
I want to add a spinner to my android application that looks like that
I want to be able to select/highlight an element on the page and find
I have a selector that binds a click event which will remove the popup.

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.