|
|
|
JavaScriptใช้ getElementsByTagName แล้วมันหาค่าไม่ได้ มันเกิดจากอะไรครับ |
|
|
|
|
|
|
|
Code (JavaScript)
<script language="JavaScript">
ele_text = form.getElementsByTagName('input');
for( i=0, elm; elm=ele_text.item(i++); )
{
if (elm.getAttribute('type') == "text")
{
alert("elm.name=" + elm.name);
alert("elm.value=" + elm.value);
}
}
ele_hidden = form.getElementsByTagName('hidden');
for( i=0, elm; elm=ele_hidden.item(i++); )
{
if (elm.getAttribute('type') == "hidden")
{
alert("elm.name=" + elm.name);
alert("elm.value=" + elm.value);
}
}
ele_textarea = form.getElementsByTagName('textarea');
for( i=0, elm; elm=ele_textarea.item(i++); )
{
if (elm.getAttribute('type') == "textarea")
{
alert("elm.name=" + elm.name);
alert("elm.value=" + elm.value);
}
}
ele_select = form.getElementsByTagName('select-one');
for( i=0, elm; elm=ele_select.item(i++); )
{
if (elm.getAttribute('type') == "select-one")
{
alert("elm.name=" + elm.name);
alert("elm.value=" + elm.value);
}
}
</script>
อยากหาค่าอะไรก็หาได้เลยครับ
|
|
|
|
|
Date :
2011-04-01 09:55:56 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณมากครับ
|
|
|
|
|
Date :
2011-04-01 10:12:27 |
By :
PikaboyZ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|