Re: How can I DomDocument->renameNode?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have tried making a new node, inserting it before the old node then
removing the old node but I could not figure out how to get the
nodeValue to include the child nodes, so they get stripped out leaving
only the text value.


You might try something like this:

function replaceNode() {
	var inChoice = document.getElementById("grafCount").selectedIndex;
	var inText = document.getElementById("textArea").value;

	var newText = document.createTextNode(inText);
	var newGraf = document.createElement("p");
	newGraf.appendChild(newText);

	var allGrafs = nodeChangingArea.getElementsByTagName("p");
	var oldGraf = allGrafs.item(inChoice);

	nodeChangingArea.replaceChild(newGraf,oldGraf);
}

 tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux