Dynamic HTML Creation
| From: | Sam Hobbs | Date: | Sat, 28 Aug 2004 06:17:29 +0000 |
| Subject: | Dynamic HTML Creation | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-194985@lists.php.net to get a copy of this message | ||
Is it possible to use the DOM to add (HTML) elements to a page at the time
the page is being shown? The HTML and VBScript shown below is a simplified
version of what I need to do but of course I need to do it in PHP. Since PHP
is server-side (right?) perhaps it is not possible.
<HTML>
<HEAD>
<Title>Dynamic Table Demo</Title>
</HEAD>
<Script Language=VBScript>
Sub Window_Onload
Set NewRow = document.createElement("TR")
Set NewCell = document.createElement("TD")
NewCell.innerText = "Cell Text"
NewRow.appendChild NewCell
TableBody.appendChild NewRow
End Sub
</Script>
<Body>
<h1>Dynamic Table Demo</h1>
<Table Id=NewTable Cols=1 border=1 Width=50%>
<TBody Id=TableBody>
</TBody>
</Table>
</Body>
</HTML>