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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:02:52+00:00 2026-05-22T01:02:52+00:00

how can I dynamically change the html table contents if the table is in

  • 0

how can I dynamically change the html table contents if the table is in a pop up which will be displayed while pressing a button?

I know we can change the content using the below function

function change(){
    var x=document.getElementById('tbl').rows
    var y=x[0].cells
    y[0].innerHTML="NEW CONTENT"
}

But it is only possible when the table is on the same window. In case of pop up it will not change.

  • 1 1 Answer
  • 1 View
  • 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-22T01:02:52+00:00Added an answer on May 22, 2026 at 1:02 am

    You can access the elements in a window you open using windowRef.document.getElementById(...) like so:

    <script type="text/javascript">
    // Global used here, would use in a closure in RL
    var popupWindow;
    
    function popWin() {
      var content = '<title>Popup window</title>' +
                    '<table id="tbl">' +
                    '<tr><td>Row 0 Cell  0<td>Row 0 Cell  1' +
                    '</table>';
      var newWin = window.open('','newWin');
      newWin.document.write(content);
      newWin.document.close();
      return newWin;
    }
    </script>
    <p>Some examples of accessing the content of a popup
       created by script in this page</p>
    
    <input type="button" value="Open popup" onclick="
      popupWindow = popWin();
    ">
    <input type="button" value="change table content" onclick="
      if (popupWindow) {
        var tbl = popupWindow.document.getElementById('tbl');
        tbl.rows[0].cells[0].firstChild.data = 'hey hey!';
      }
     ">
     <input type="button" value="Close popup" onclick="
       if (popupWindow) {
         popupWindow.close();
         popupWindow = null;
       }
     ">
    

    However it’s worth noting that most users hate popups, will block them unless they are initiated by a user action (click or similar), and may close them without you knowing. Also, you can only do the above with windows that you open, you can’t randomly change the content, or even access, any window.

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

Sidebar

Related Questions

I'm having a problem while trying to dynamically change a table cell's styling class
I'm dynamically generating a PDF using ABCpdf which contains a table of contents that
I have a Html Table which consists of rows that were generated dynamically (from
I want to know I can dynamically modify an existing Crystal Report (using C#
Does anyone know how I can Dynamically create an installation package that installs files
In C, I know I can dynamically allocate a two-dimensional array on the heap
I'm trying to make something where you can dynamically insert an HTML block, and
I have a HTML table which is inside of a div element and I
I can dynamically append select control to DOM,after appending it to DOM,I wanna change
I can use this jQuery code to dynamically change the RSS link in the

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.