Test file for changing attributes on the PRE tag via the DOM.

git-svn-id: svn://10.0.0.236/trunk@20752 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nisheeth%netscape.com
1999-02-16 01:02:21 +00:00
parent 1b2aa59d45
commit 865f26a97a

View File

@@ -0,0 +1,29 @@
<HTML>
<BODY>
<PRE WIDTH="50">
This text is within a PRE tag. This text is within a PRE tag.
This text is within a PRE tag. This text is within a PRE tag.
This text is within a PRE tag. This text is within a PRE tag.
This text is within a PRE tag. This text is within a PRE tag.
This text is within a PRE tag. This text is within a PRE tag.
</PRE>
<P>
Use the buttons below to change the width attributes for the preformatted text above.
</P>
<FORM>
<P>
Set <I>width</I> to
<INPUT TYPE="text" NAME="width" VALUE="50">
<INPUT TYPE="button" VALUE="Change Width" onClick="changeWidth(); return true;">
</P>
</FORM>
<SCRIPT>
var pre = document.getElementsByTagName("pre")[0];
function changeWidth() {
pre.width = Math.abs(document.forms[0].width.value);
}
</SCRIPT>
</BODY>
</HTML>