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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:13:50+00:00 2026-06-16T12:13:50+00:00

I want to use javascript to add a link inside a div, this div

  • 0

I want to use javascript to add a link inside a div, this div doesn’t have id , it does has a class though:

<div class="details">
  <div class="filename">test.xml</div>
  <div class="uploaded">25/12/2012</div>

  <a href="#" class="delete">Delete</a>

  <div class="compat-meta"></div>
</div>

How to add a link inside the “details” div and above the “delete” link?
The link I want to add is:

<a href="#edit_link" class="edit">Edit</a>
  • 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-16T12:13:51+00:00Added an answer on June 16, 2026 at 12:13 pm

    go for jquery, it’s simple and clean.

    you can grab any element with a particular class say

    <div class="className" ></div>
    

    like this

    <script>
    $('.className'); 
    </script>
    

    now you want to append someother element just before the anchor having delete class, well than you can do this:

    $('.delete').before('<a href="#edit_link" class="edit">Edit</a>'); 
    

    there are other methods also to append an element inside any other element or dom

     1. $('.className').append('<div> i will be appended at the bottom of this element</div>');
     2. $('.className').after('<div> i will be appended right after this element</div>');
    

    for using jquery, you will need its api, directly use this link in your page or, download the latest jQuery api and use it.
    its simpler and easier.

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

Sidebar

Related Questions

I am use jqGrid. I want to add record inline navigation so this link
I have an HTML file and I want to use javascript to call a
I want to use a javascript countdown function similar to this http://jsfiddle.net/Apnu2/6/ when a
I have a label and I want to add to it a link. I
i have this menu in javaScript: menu[1] = { id: 'menu1', //use unique quoted
I can add a product to cart via GET with this link: <div id=add><a
I want to add javascript enable pane in my java webbrowser. I have heard
I want use javascript setInterval function to achieve a box rotate animate effect, I
I want to use javascript to detect if an element exists under the cursor
I want to use javascript / jquery to determine if an xml file exists.

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.