日期:2014-05-16 浏览次数:20398 次
<form name="form" > <input type="text" id="tx1" value="123"><br> </form> <script> alert(form.tx1.value); </script>
<form id="form" > <input type="text" id="tx1" value="123"><br> </form> <script> alert(form.tx1.value); </script>
<form id="form" > //form篇2 <input type="text" id="tx1" value="123"><br> </form> <script> alert(form.elements['tx1'].value); </script>
<form id="form" > //form篇2 <input type="text" name="tx1" value="123"><br> </form> <script> alert(form.elements['tx1'].value); </script>