Vanitha wrote:
The following syntax is not working on Mozilla browser, however this
works on IE.
<input id="freq" size="20" name="freq" type="text">
That is HTML and not JavaScript so it is off topic here but I am sure
Mozilla can render a HTML document containing that markup for an input
type="text" control.
When i refer this freq from a javascript functio like freq.value, its
giving the erro freq not defined in the Javascript console of Mozilla
browser
Learn about the W3C DOM then on how to access elements by their id in
modern browsers:
var input;
if (document.getElementById) {
input = document.getElementById('freq');
}
else if (document.all) {
input = document.all['freq'];
}
// now use the input element object e.g.
if (input) {
input.value = 'Kibology';
}
But for scripting form controls it might be easier and reach more
browsers if you simply use
document.forms.formName.elements.freq.value = 'Kibology'
at least if the <input> sits inside of a
<form name="formName" ...>
ancestor.
--
Martin Honnen
http://JavaScript.FAQTs.com/