Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How to add new elements dynamically.
How to add new elements dynamically.
✍: Guest
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>t1</title>
<script type="text/javascript">
function addNode() {
var newP = document.createElement("p");
var textNode = document.createTextNode(" I'm a new text node");
newP.appendChild(textNode);
document.getElementById("firstP").appendChild(newP);
}
</script>
</head>
<body onload="addNode();" style=" background: url('../images/Sand-1280.jpg'); background-color: yellow;">
<p id="firstP">firstP<p>
</body>
</html>
2011-02-22, 3763👍, 0💬
Popular Posts:
What is the difference between Session State and ViewState? ViewState is specific to a page in a ses...
.NET INTERVIEW QUESTIONS - What are Daemon threads and how can a thread be created as Daemon? Daemon...
What is XSLT? XSLT is a rule based language used to transform XML documents in to other file formats...
What is the quickest sorting method to use? The answer depends on what you mean by quickest. For mos...
How To Specify Two Background Images on a Page? - CSS Tutorials - Page Layout and Background Image D...