I'm having some difficulty with my showCode() function I created. The purpose of this function is to hide the preview frame and to increase the size of the textarea fields in the html.htm and css.thm documents that I have with me. Here are the steps for this code:
1. Set the value of the demo frameset's row attribute to "100,*,1" (the frameset's ID is "demo" btw).
2. Change the height of the textarea field in the html.htm file to 300 pixels (There's a hint given that I have to move up to the parent object and then down to the second frame in the frames collection to reference the contents of the html.htm document. I'm then to use the document.getElementById() method to reference the textarea field and use the style.height property to set the textarea field's height to 300 pixels.)
3. Change the height of the textarea field in the css.htm file to 300 pixels also. css.htm is the third frame of the frames collection.
So, this is what I came up with:
parent.document.getElementById("demo").rows = "100,*,1";
parent.frames.document.getElementById("inputhtml").textarea.style.height = "300px";
parent.frames.document.getElementById("inputcss").textarea.style.height = "300px";
So I'm getting the "null or not an object" error message for the first line. Where am I going wrong?