ralphtrent
Programmer
Hey, I am fairly new to the whole javascript client-side world. Worked with it a little bit here and there but now I am doing more with it. I have a script below that I am trying to run to get me the types and names of an element, can anyone see why I am geting [object] as the return value for "Elements" section?
Thanks
Ralph
<script language="javascript" type="text/javascript">
function loops()
{
document.write("<table border=0>"
document.write("<tr><td colspan=3>Number of Forms: "+document.forms.length+"</td></tr>"
for(count=0;count<document.forms.length;count+=1)
{
var formNum = count+1;
document.write("<tr><td>"+formNum+"</td><td>Number of elements:</td><td>"+document.forms[count].length+" elements</td></tr>"
document.write("<tr><td></td><td>Name:</td><td>"+document.forms[count].name+"</td></tr>"
document.write("<tr><td></td><td>Action:</td><td>"+document.forms[count].action+"</td></tr>"
document.write("<tr><td></td><td>Elements:</td><td>"+document.forms[count].element+"</td></tr>"
document.write("<tr><td colspan=3><hr></td></tr>"
}
document.write("</table>"
}
</script>
Thanks
Ralph
<script language="javascript" type="text/javascript">
function loops()
{
document.write("<table border=0>"
document.write("<tr><td colspan=3>Number of Forms: "+document.forms.length+"</td></tr>"
for(count=0;count<document.forms.length;count+=1)
{
var formNum = count+1;
document.write("<tr><td>"+formNum+"</td><td>Number of elements:</td><td>"+document.forms[count].length+" elements</td></tr>"
document.write("<tr><td></td><td>Name:</td><td>"+document.forms[count].name+"</td></tr>"
document.write("<tr><td></td><td>Action:</td><td>"+document.forms[count].action+"</td></tr>"
document.write("<tr><td></td><td>Elements:</td><td>"+document.forms[count].element+"</td></tr>"
document.write("<tr><td colspan=3><hr></td></tr>"
}
document.write("</table>"
}
</script>