Isaac
asked on
Javascript html dynamic rendering
What's the best way to render the below(buildTargetTable()) to the browser? I'm trying to build a table on the fly as the page is getting rendered.
The below works but only if I alert it or console.log it. What I want to do is make it render to the browser.
Any ideas?
Thanks!
The below works but only if I alert it or console.log it. What I want to do is make it render to the browser.
<!DOCTYPE html>
<script LANGUAGE="JavaScript">
function buildTargetTable(tblType)
{
var tbl = "";
tbl = "<Table id="+tblType+"></Table>";
return tbl;
}
buildTargetTable("PBC");
buildTargetTable("Sample");
buildTargetTable("Whatever");
</script>
Any ideas?
Thanks!
ASKER
i tried that before asking for help but it did not work.
Also, isn't there a downside to using document.write
Also, isn't there a downside to using document.write
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window