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

The Archive Base Latest Questions

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

I have HTML code like this : <li><input type=hidden value=001 class=block-hidden-input /> <a href=#

  • 0

I have HTML code like this :

<li><input type="hidden" value="001" class="block-hidden-input" />
    <a href="#" id="manage-1" class="manage-content-link">
        <img src="images/web-block/web-block1.jpg"/>
        <span class="orange-notice">Click to Edit Content</span>    
    </a>
</li>

<li><input type="hidden" value="002" class="block-hidden-input" />
    <a href="#" id="manage-2" class="manage-content-link">
        <img src="images/web-block/web-block2.jpg"/>
        <span class="orange-notice">Click to Edit Content</span> 
    </a>
</li>

each li tag has unique id and it has following format : id=”manage-X”. each user can have multiple li tag, so it’s dynamic.

on the other hand, I need this jQuery to handle that li tags :

$('#manage-1').click(function(e) { 
    $(this).next(".manage-content-wrap").find(".manage-content").load("file-001.php");
    e.preventDefault();
});
$('#manage-2').click(function(e) { 
    $(this).next(".manage-content-wrap").find(".manage-content").load("file-002.php");
    e.preventDefault();
});

this jQuery looks so awful. because it’s static and if I have 5 li tags, means I have to copy-and-paste 5 times. I don’t know how to make it dynamic on jQuery.

plus, “file-001.php” and “file-002.php” are based on li’s value. so, it must be in this format file-XXX.php (replace XXX with li’s value). I guess this must be related with RegEx. but I have no clue how to do it…

any idea how to make that jQuery dynamic based on li tags? thanks!

  • 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-13T06:20:16+00:00Added an answer on June 13, 2026 at 6:20 am

    Try changing your selector to be class-based. Then you’ll simply need a way to figure out which file to load. The following example assumes that the value of your hidden inputs contains the file number to load:

    $('a.manage-content-link').click(function (e) {
        var self = $(this),
            file = self.siblings('input[type="hidden"].block-hidden-input').val();
        self.next(".manage-content-wrap").find(".manage-content").load("file-" + file + ".php");
        e.preventDefault();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following html code like this: <div class="question"> <input class="cross-reference-question-value-id" id="enr_rds_question_ids" name="enr_rds_surv_rdsap_xref[enr_rds_question_id]"
I have this code on HTML side : <form action=testx.php method=post> <input type=hidden name=block-1
I have this HTML: <tr> <td> <input type=hidden name=MatchId[] value=> <select name=TeamId[]> <optgroup label=Women>
I have html code like this <tr class=odd> <td><b>Reason for Termination:</b></td> <td>this has bunch
I have HTML code like this: <asp:LinkButton ID=AddButton runat=server OnClick=AddPatientBtn_Click> <span class=Normal>Add</span> </asp:LinkButton> I
I have an html page with a link like this: <a href=javascript:window.print()>Print QR code</a>
I have HTML code like below <input type = textarea id=sentence1> Here is my
I have these two in my html code: <input class=input1 type=text size=15 name=login> <input
I have the below code in my .aspx page. <input type=hidden id=fbinfo name=fbinfo value=
I have code like this: <html> <SCRIPT language=javascript> function add() { //Create an input

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.