เมื่อใช้ jQuery คุณสามารถตั้งค่าได้ดังนี้:
แบบฟอร์มแบบฟอร์ม:
<form name = "myform" id = "myform" action = "ssss" method = "post" onsubmit = "geturl ();">
วิธี JavaScript:
<script type = "text/javascript"> ฟังก์ชั่น geturl () {$ ('ฟอร์ม'). attr ('การกระทำ', 'new_url'); } </script>หรือใช้ JavaScript ง่าย ๆ :
ฟังก์ชั่น test1 () {alert (document.myform.action); // ค่าส่งคืน: http: // localhost: 8080/xxx/ssss แจ้งเตือน (document.myform.attributes ["การกระทำ"]. // ค่าส่งคืน: SSS นั้นแตกต่างจากบรรทัดก่อนหน้านี้ document.getElementById ('myform'). action = 'new_url'; document.myform.action = 'new_url'; document.myform.attributes ["action"]. value = 'new_url';}วิธีง่ายๆข้างต้นในการกำหนดค่าของแอตทริบิวต์การกระทำของแบบฟอร์มแบบไดนามิกแบบไดนามิกคือเนื้อหาทั้งหมดที่ฉันแบ่งปันกับคุณ ฉันหวังว่าคุณจะให้ข้อมูลอ้างอิงและฉันหวังว่าคุณจะสนับสนุน wulin.com มากขึ้น