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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:01:27+00:00 2026-06-16T05:01:27+00:00

I have a series of div’s with assigned class ‘steps’, each div is separated

  • 0

I have a series of div’s with assigned class ‘steps’, each div is separated by a <hr /> element. Each div contains distinct text.

I need to traverse, using prototype, to a specific hr which has a div with certain text.

For e.g. I need reference to <hr /> that is above div containing jkl

<div class="content">abc</div>
<hr />
<div class="content">def</div>
<hr />
<div class="content">ghi</div>
<hr />
<div class="content">jkl</div>
<hr />
<div class="content">mno</div>
<hr />
<div class="content">pqr</div>

I reckon, we need to first find reference to the div, this can be achieved using the following selector:

$$('div.content:contains("jkl")')

But the :contains selector is only supported in v1.7, and I have v1.6 at disposal, that doesn’t identify the selector.

Looking forward to a push.

  • 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-16T05:01:28+00:00Added an answer on June 16, 2026 at 5:01 am

    If you don’t have 1.7 available you can try this – I don’t like doing this but it will work.

    $$('div.content').each(function(div){
        if(div.innerHTML.include('jkl'))
        {
           //Do something here
        }
    });
    

    here is a jsfiddle of the HTML with this snippet of code http://jsfiddle.net/jwestbrook/zdvyD/

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

Sidebar

Related Questions

I have a series of <div class=clear-both></div> after a series of divs. I want
I have a series of divs like this: <div id=listofstuff> <div id=anitem> <span class=itemname>Item1</h3></span>
I have a series of divs like this: <div id=available-posts> <div class=post id=unique_id> <a
I have a series of divs: <div class=some_class active>Some Content</div> <div class=some_class>Different Content</div> <div
I'm trying to have a series of tiles inside a wrapping div element. At
I have a series of items: https://i.stack.imgur.com/z5Ldg.jpg Each item is structured like this: <div
I have a series of horizontal div boxes that I need to add the
I have a series of input elements each with a few <div> tags separate.
I have a series of boxes: <div class=box></div> <div class=box></div> <div class=box></div> <div class=box></div>
I have a series of links nested within a div. When one of those

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.