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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:41:30+00:00 2026-06-13T16:41:30+00:00

Is there a non-hackish way to append to or use some elem (noted by

  • 0

Is there a non-hackish way to append to or use some elem (noted by an id) and append to it but after it before a block element. Not sure how to explain this.

I have various pages. And I have to insert some data (that is generated via ajax). Now, this data is retrieved after the page is loaded and as such, I have to inject some content – but because the pages are different (I want to use a plugin so I can just drop it into these pages and boom – dynamic content is placed appropriately).

** EDIT ::: If there is text after the HREF, my inserted items must be after it (and subsequent br tag). I was thinking that perhaps I insert after the href up to the last block element (div) or if not, then bottom of the div (noted in last example).

for some pages, the layout is like this..

<td>
  <div>
     <a href="someurl" id="uniqueIDhere">monsters</a>  come see this show!!<br>
     // span with content injected here
  </div>

or

<td>
  <div>
     <a href="someurl" id="uniqueIDhere">monsters</a>
     // span with content injected here
  </div>

or

 <td>
     <a href="someurl" id="uniqueIDhere">monsters</a>
     // span with content injected here
 </td>

or

<td>
  <div>
    <span>
     <a href="someurl" id="uniqueIDhere">monsters</a> yo you yo yo yo<br>
    </span>
     // span with content injected here
  </div>

So, that href could be wrapped in a DIV or a SPAN or not.. but its always in a TD..
So, basically I want to inject my “new dynamic” data within the last div of the TD or if there is none, just at the end of the td (but still in it).

any ideas? I figure to use the href ID (should use this as there are a few links i Have to do this to), get the parent TD and then append to it in some fashion?

  • 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-13T16:41:32+00:00Added an answer on June 13, 2026 at 4:41 pm

    Seems like you’re looking for the jQuery after() method:

    Insert content, specified by the parameter, after each element in the
    set of matched elements.

    $("#uniqueIDhere").after("<div>INSERT WHATEVER HERE</div>")
    

    EDIT:

    After reading this question again, I think you may be looking for .append():

    $("div").has("#uniqueIDhere").append("<div>INSERT WHATEVER HERE</div>")​
    

    Here we use .has() to filter the list of div elements that do not contain uniqueIDhere and then use .append() to add the text, html, etc.. to the end of the div.

    EXAMPLE

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

Sidebar

Related Questions

There are some ARIA tutorial websites use non-semantic markup and some javascript to demostrate
Is there a non-IIS way of authenticating users that is not with HTML? I
Is there a non-hacky (i.e. no assembly, ...) way to use boost functions to
Is there a non javascript way to stretch an element either in relation to
Is there any non-hacky way to determine wether a class' superclass implements a particular
Is there a way to make a variable non-inheritable in python? Like in the
Is there a way for a non admin user to check the uptime of
Is there any way to make only a non-transparent portion of an image to
Is there a way that I can add non-static data to dataannotation attributes (either
Is there any [non programming language specific] way to get hex versions of object

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.