Second when using the latter method the generated html sets the "value" to the innerHTML. The resulting HTML when view by "Inspect" looks like this.
Note: [the element close text </param> is correctly displayed using Inspect but when using File->SavePageAs the ending text is not saved correctly. I have reported this in another Moz. question in FF Help.]
function setparamAttrs(parmID, parmVal)
var gData = document.createDocumentFragment();
var newNode = document.createElement("param");
var textStr = document.createTextNode(parmVal);
//newNode.setAttribute("value", parmVal); // this does not work
//newNode.setAttribute("innerHTML", parmVal); //this does not work
I was, however, able to retrieve the "value" after it was appended using:
var val = document.getElementById("parm0").value);
getAttribute("value") does not work either.
Finally I added the param elements to my HTML as this;
<param id="myID">myValue</param>. I then attempted to extract the value using document.getElementById("myID").innerHTML. No text was returned. When I examined the HTML document with Inspect my HTML param element was displayed as <param id="myID">myVal. The closing element text was missing the same as when I use SavePageAs that I previously reported.