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 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
  • 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-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've googled around, but i can find a way to build json with jQuery
I'd like to use a slider on a html form using jQuery. The slider
I have to return data fetched from MySQL table into a php file as
I have an <abbr> tag with class timeago in my HTML. When I set
I have an HTML form that builds a drop-down from json data that is
I am trying to use a textarea form entry which I have some javascript
I have a html page with 2 buttons on it and a big javascript
I’m selecting a report generator for my .NET winforms app and it’s driving me
I am very new to object orientated javascript, with experience writing gui's in python
These formsets are exhibiting exactly the opposite behavior that I want. My view is

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.