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.
You can access the elements in a window you open using
windowRef.document.getElementById(...)like so: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.