Basically I have two javascript files that are separated but linked to a single html file. In this html file, in the js sections (i.e script section) I have declared a variable which I would like to print in an innerHTML part of the other js file where I am currently making a table.
Here I declared the variable in the script section of the html file:
var varIwanttoprint = 'data/rnase.mtz'
Here is the code for the table
var tab1 = document.getElementById("tab1");
tab1.innerHTML ='<p><hr></p><h3>General data</h3>' +
'<table class="table-blue">'+
'<tr><td>Path</td><td>**The variable i want to print here**</td></tr>'
However, I can't seem to find a way to print the js value of the js variable inside the html table. Is there any way I can do this?
Thank you
innerHTMLpart of the code is in a function, then you can call the function and pass the variable as an argument.