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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:24:21+00:00 2026-06-12T01:24:21+00:00

I have an html page that has many elements (tables, divs e.t.c) I get

  • 0

I have an html page that has many elements (tables, divs e.t.c) I get them as string and I want to extract this format <img src="(whatever char).jpg" (whatever char)> from the string, I tried regexp tutorials but couldn’t do anything as it was to complicated to me. And I need only the first occurrence, thanks.

  • 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-12T01:24:22+00:00Added an answer on June 12, 2026 at 1:24 am

    I don’t think regex is the right way to go about this:

    var all_images = document.getElementsByTagName('img');
    var filtered_images = [];
    
    for (var i = 0; i < all_images.length; i++) {
        var image = all_images[i];
    
        if (image.hasAttribute('src')) {
            filtered_images.push(image);
        }
    }
    

    If you were using jQuery, the code would be much simpler:

    var images = $('img[src]');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an HTML page that has many nested tables, for example table for
Good Afternoon, I have a html aspx page that has many many div elements.
This is bugging me ... I have a simple HTML page that has a
Currently I have an HTML page that has many textboxes that need to be
I have a page that has many posts by different authors. I want the
I have a page that I need to design in PhP/Html/Java/CSS that has to
I have an HTML page that contains some filenames that i want to download
I have an HTML page that roughly looks like this: <div id=rolesRollerBody style=height: 309px;>
I have this wordpress blog that has many pages with subpages that dropdown on
I have a define.php page that has many variables in it. I use to

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.