Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q643 How can I display a variable in my HTML page, is the answer &{script-statements};?

You are here: irt.org | FAQ | JavaScript | Misc | Q643 [ previous next ]

Your talking JavaScript entities with &{JavaScript-code}; - which is only supported in Netscape Navigator, and they can only be used within the attributes of an HTML tags attributes, e.g.

<P>
Hello my name is
<FORM>
<INPUT TYPE="TEXT" VALUE="&{document.formname.fieldname.value}">
</FORM
</P>

To output the value of a form field within the page text flow can be achieved in all JavaScript enabled browsers with:

<P>
Hello my name is
<SCRIPT LANGUAGE="JavaScript"><!--
document.write(document.formname.fieldname.value);
//--></SCRIPT>
</P>

©2018 Martin Webb