แอตทริบิวต์ type ขององค์ประกอบ ใช้เพื่อกำหนดประเภทของปุ่ม ต่อไปนี้เป็นไวยากรณ์ - <button type="button|submit|reset"> ด้านบน เราได้แสดงประเภทต่าง ๆ ที่กำหนดไว้สำหรับองค์ประกอบปุ่ม เช่น ส่ง - ปุ่ม: ปุ่มที่คลิกได้ ส่ง: ปุ่มส่ง (ส่งข้อมูลแบบฟอร์ม) รีเซ็ต: เป็นปุ่มรีเซ็ตเพื่อรีเซ็ตเป็นค่าเริ่มต้น ให้เราดูตัวอย่างการใช้แอตทริบิวต์ type ขององค์ประกอบปุ่มใน HTML - ตัวอย่าง <!DOCTYPE html> <html> <body> <h2>Investor Information</h2> <p>Give the information about the investor interested in funding:</p> <form action="" method="get"> ID: <input type="number"><br> Investor: <input type="text"><br> Funds: <input type="number"><br> Email: <input type="email"><br> DOB: <input type="date"><br><br> <button type="submit" value="Submit">Submit</button> <button type="reset" value="Reset">Reset</button> </form> </body> </html> สิ่งนี้จะสร้างผลลัพธ์ต่อไปนี้พร้อมปุ่มส่งและรีเซ็ต - ในตัวอย่างข้างต้น เราได้สร้างแบบฟอร์มที่มีองค์ประกอบของแบบฟอร์มและปุ่ม - <form action="" method="get"> ID: <input type="number"><br> Investor: <input type="text"><br> Funds: <input type="number"><br> Email: <input type="email"><br> DOB: <input type="date"><br><br> <button type="submit" value="Submit">Submit</button> <button type="reset" value="Reset">Reset</button> </form> ประเภทของปุ่มที่เราตั้งไว้เพื่อสร้างการส่งและอีกปุ่มหนึ่งซึ่งจะเป็นปุ่มรีเซ็ต - <button type="submit" value="Submit"> Submit </button> <button type="reset" value="Reset"> Reset </button>