JavaScript返回表单的enctype属性
<!DOCTYPE html> <html> <body> <form id="frm1" enctype="text/plain"> First name: <input type="text" name="fname" value="Donald"><br> Last name: <input type="text" name="lname" value="Duck"><br> </form> <p>Form data will be encoded as: <script> document.write(document.getElementById("frm1").enctype); </script> </p> </body> </html>
上面的代码返回:Form data will be encoded as: text/plain