คุณสมบัติประเภทการส่งอินพุต HTML DOM เชื่อมโยงกับองค์ประกอบอินพุตที่มี type=”submit” มันจะส่งคืนการส่งสำหรับองค์ประกอบการป้อนข้อมูลเสมอ
ไวยากรณ์
ต่อไปนี้เป็นไวยากรณ์สำหรับคุณสมบัติประเภทการส่ง -
submitObject.type
ตัวอย่าง
ให้เราดูตัวอย่างคุณสมบัติประเภทการส่ง -
<!DOCTYPE html>
<html>
<body>
<h1>Input range type Property</h1>
<form>
VOLUME <input type="range" id="RANGE1" name="VOL">
</form>
<p>Get the above input element type by clicking the below button</p>
<button type="button" onclick="rangeType()">GET Type</button>
<p id="Sample"></p>
<script>
function rangeType() {
var P=document.getElementById("RANGE1").type;
document.getElementById("Sample").innerHTML = "The type for the input field is: "+P ;
}
</script>
</body>
</html> ผลลัพธ์
สิ่งนี้จะสร้างผลลัพธ์ต่อไปนี้ -

เมื่อคลิกปุ่ม "GET Type" -
