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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:48:29+00:00 2026-05-14T18:48:29+00:00

How to find all the anchor tags inside a div tag and need to

  • 0

How to find all the anchor tags inside a div tag and need to append one more property to the anchor tag. say target="_blank".

How can i do this in using jquery?

  • 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-14T18:48:30+00:00Added an answer on May 14, 2026 at 6:48 pm

    Do you mean all the anchors in any div element, or in some specific div element? If it’s the former, this will do the trick:

    $('div a').attr('target', '_blank');
    

    If it’s a particular div you’re interested in, give that element an id attribute and then use it like so:

    $('#divid a').attr('target', '_blank');
    

    replacing “divid” with the id in question.

    Can you be more specific about what exactly you want?

    In any case, you’re going to need to use the attr() function to set the attribute; see the documentation here.

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

Sidebar

Related Questions

how can i find all the anchor tags with source pdf $string=hello this is
i'm trying to find all the anchor tags and appending the href value with
I think all I need is a selector, but can't find one. I want
I need to find all the occurences of a file Test.TXT in c:\ or
I need to find all CIDs (Contracts) meet the following conditions They are active
I need to find all occurences of 'Of' (case sensitive) in table Cities .
What Xpath expression can I use to find all the anchor (just 'a') elements
I have a container and inside that I have several anchor tags. These anchor
I need to find all the URLs on the page using jQuery. They will
I have anchor tag inside a gridview which im using javascript onclick to 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.