Hello, I am a new programmer and I am working on a school project. I am being instructed to move up then down the dom. My parent is demo.html then a frameset and then another frameset within the frameset. I have figured out how to get up to the parent and then down to the first frameset and change the rows attribute. However I am stuck on getting to the next level, I am required to change the height of the second frameset textarea to 300 pixels.
here is the code for the demo.html
[HTML]<html>
<head>
<!--
New Perspectives on JavaScript
Tutorial 6
Case Problem 3
Web Design Demo
Filename: demo.html
Supporting files: css.html, html.html, title.html
-->
<title>HTML Demo</title>
</head>
<frameset rows="100,210,* " id="demo" name="demo">
<frame name="title" id="title" src="title.html " scrolling="no" />
<frameset cols="*,*">
<frame name="code1" id="code1" src="html.html" />
<frame name="code2" id="code2" src="css.html" />
</frameset>
<frame name="output" id="output" />
</frameset>
</html>
here is the code for the title.html
<html>
<head>
<!--
New Perspectives on JavaScript
Tutorial 6
Case Problem 3
Web Design Demo Control Buttons
Author: Greg Funston
Date: November 9,2008
Filename: title.html
Supporting files: title.css
-->
<title>Web Design Demo Control Buttons</title>
<link href="title.css " rel="stylesheet " type="text/css" />
<script src="" type="text/javascript"></script>
<script type="text/javascript">
function showPreview(){
parent.document .getElementById ("demo").rows=" 100,*,1"
}
function showCode(){
parent.document .getElementById ("demo").rows=" 100,1,*"
parent.frames.d ocument.getElem entById("code1" ).textarea.styl e.height="300"
parent.frames.d ocument.getElem entById("code2" ).textarea.styl e.height="300"
}
function showBoth(){
parent.document .getElementById ("demo").rows=" 100,210,*"
}
</script>
*/
</head>
<body>
<form name="control" id="control" action="">
<h2 id="demotitle"> Creating Web Pages</h2>
<p>
<input type="button" value="Submit Code" onclick='sendCo de()' >
<input type="button" value="Show Only Code" onclick='showCo de()' >
<input type="button" value="Show Only Preview" onclick='showPr eview()' >
<input type="button" value="Show Code and Preview" onclick='showBo th()' >
</p>
</form>
</body>
</html>
[/HTML]
I would appreciate the help to find the problem with my code.
here is the code for the demo.html
[HTML]<html>
<head>
<!--
New Perspectives on JavaScript
Tutorial 6
Case Problem 3
Web Design Demo
Filename: demo.html
Supporting files: css.html, html.html, title.html
-->
<title>HTML Demo</title>
</head>
<frameset rows="100,210,* " id="demo" name="demo">
<frame name="title" id="title" src="title.html " scrolling="no" />
<frameset cols="*,*">
<frame name="code1" id="code1" src="html.html" />
<frame name="code2" id="code2" src="css.html" />
</frameset>
<frame name="output" id="output" />
</frameset>
</html>
here is the code for the title.html
<html>
<head>
<!--
New Perspectives on JavaScript
Tutorial 6
Case Problem 3
Web Design Demo Control Buttons
Author: Greg Funston
Date: November 9,2008
Filename: title.html
Supporting files: title.css
-->
<title>Web Design Demo Control Buttons</title>
<link href="title.css " rel="stylesheet " type="text/css" />
<script src="" type="text/javascript"></script>
<script type="text/javascript">
function showPreview(){
parent.document .getElementById ("demo").rows=" 100,*,1"
}
function showCode(){
parent.document .getElementById ("demo").rows=" 100,1,*"
parent.frames.d ocument.getElem entById("code1" ).textarea.styl e.height="300"
parent.frames.d ocument.getElem entById("code2" ).textarea.styl e.height="300"
}
function showBoth(){
parent.document .getElementById ("demo").rows=" 100,210,*"
}
</script>
*/
</head>
<body>
<form name="control" id="control" action="">
<h2 id="demotitle"> Creating Web Pages</h2>
<p>
<input type="button" value="Submit Code" onclick='sendCo de()' >
<input type="button" value="Show Only Code" onclick='showCo de()' >
<input type="button" value="Show Only Preview" onclick='showPr eview()' >
<input type="button" value="Show Code and Preview" onclick='showBo th()' >
</p>
</form>
</body>
</html>
[/HTML]
I would appreciate the help to find the problem with my code.
Comment