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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:14:13+00:00 2026-05-18T11:14:13+00:00

hey, had no idea what title this post should have, hard to describe :)

  • 0

hey,
had no idea what title this post should have, hard to describe 🙂

i have a dynamic id’s with a number

<div id="post-full-116">Content</div>

<div id="post-116">Content</div>

i want to query the dynamic number (in this case 116) of id=”post-full-116″ and if another div on the page with id=”post-116″ exists i want to remove that.

sounds weird i know. so you get the idea behind it, the div with id=”post-number” holds a preview of a post and the the div with id=”post-full-number” holds the full content of a post.

i don’t want to show the preview of a post if the full post is already shown – so i simply want to hide it with jquery. i know i should do that on the serverside before, however in this case jquery would be perfect.

any idea how i can query the number of the dynamic id and the remove the appropriate div with the same number?

thank you

  • 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-18T11:14:13+00:00Added an answer on May 18, 2026 at 11:14 am

    I’m thinking you would do something like this:

    $(function() {
        $('[id^=post-full]').each(function() {
             var num = $(this).attr('id').replace(/post\-full\-/,'');
             $('#post-' + num).hide();
        });
    });
    

    That should grab any “full” posts, find the number of the post, and hide the “preview” version of it.

    UPDATE:

    Here’s a live demo of that: http://jsfiddle.net/Ender/saUQf/

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

Sidebar

Related Questions

Hey guys i had an idea yesterday. Can you help me with this. Here
Hey, Since Google Fonts came out, I have had this question in mind. First
Hey This is my login script, using PHP5 and MYSQLi, I just had help
hey, this i have a loop that adds gathered strings and ints into an
hey there, just practising and I had a question. I have a program (source
Hey all. Quick question on Fluent syntax. I had thought I had this down,
Hey I had this question in an interview and was wondering what was the
Hey so I have this case where if a page contains text and text
Hey this is one of the classes that I had for homework in my
Hey everyone, I had a quick question that should be easy for someone who

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.