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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:04:50+00:00 2026-06-07T05:04:50+00:00

On server side, I generate some div with these IDS, for example : <div

  • 0

On server side, I generate some div with these IDS, for example :

<div id="ContentPlaceBody_Example_localita_168">Hello</div>
<div id="ContentPlaceBody_Example_localita_80">my name is</div>
<div id="ContentPlaceBody_Example_localita_740">Marco</div>

so, on client side, Id like to select these IDS checking the last part of the ID (that is fixed, can’t change, _localita_UNIQUEID). Such as :

var myID = "80";
$('# HERE THE SELECTOR I NEED _localita_'+myID).hide();

is there a fast way?

  • 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-07T05:04:52+00:00Added an answer on June 7, 2026 at 5:04 am

    Use ends with selector: http://api.jquery.com/attribute-ends-with-selector/

    Try this:

    var myID = "80";
    $('div[id$="localita_'+myID + '"]').hide();
    

    Update:
    @raina77ow ‘s comment made me dig more and here’s an alternatives to make it better.

    (Refer to the excellent post on this: http://encosia.com/11-keystrokes-that-made-my-jquery-selector-run-10x-faster/)

    Give a class name to the divs (e.g: “endswith”) you need to query by ends with and then use this version to make it perform better:

    var myID = "80";
    $('div.endswith[id$="localita_'+myID + '"]').hide();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I need to generate some files on server side and return them to
I'm hoping to generate my server-side and client-side validation (ish) using meta data on
I add some div into a panel on server side, when the page is
I want to generate a PDF file on server side, and then in response
I'm looking for a reliable mechanism to generate a server side postback handler for
I have some logic I want to run on the server-side. It's implemented in
We are working on complex solution that contains ASP.Net-based server-side and several client applications
I'm working on some code that generates an Excel spreadsheet server-side and then downloads
I need to generate PDF documents server-side that include a map, with markers and
I'm new in web services. I have faced some problem. At the server side

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.