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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:15:36+00:00 2026-05-18T06:15:36+00:00

I have one function of java-script which is adding content to my HTML page.

  • 0

I have one function of java-script which is adding content to my HTML page. Also I have light box script added on that page. Now when i am calling light-box function after page load light box script is working fine but when I call that java script function which is appending HTML to my page then on click of the content of added HTML light-box is not working.What should I do

my code is like this

function add_new_block()
{
    strnew='<div>\n 
                <div class="normal_red">
                    <a href="javascript:void(0);" onclick="return add_new_block();">Add more</a>
                </div>
                <a href="ajax_show_specific.php?subcat_id=1&catid=2" class="lbOn">Be More Specific</a>
           </div>';

    document.getElementById("newdiv"+(newcount-1)+subcatid).innerHTML=strnew;
}

Thanks for Help in Advance

  • 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-18T06:15:37+00:00Added an answer on May 18, 2026 at 6:15 am

    I suspect it’s because the new elements are binded to the DOM and so the lightbox script can’t “see” them. Do you have some initialisation script for the lightbox? Something like initLightbox()? If so add that to the end of your add_new_block(); function.

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

Sidebar

Related Questions

Ok, I have one JavaScript that creates rows in a table like this: function
I have a javascript function (class) that takes a function reference as one paremter.
I am developing a C# program, and i have one function that consumes too
I have a function which parses one string into two strings. In C# I
I have a function that resembles the one below. I'm not sure how to
I have a function that accepts a char* as one of its parameters. I
Imagine I have an function which goes through one million/billion strings and checks smth
I have a script that appends some rows to a table. One of the
I have JavaScript Function in which I check for value of a stageId box
Say I have the following code: function One() {} One.prototype.x = undefined; function Two()

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.