HTML DOM इनपुट सर्च टाइप प्रॉपर्टी उस इनपुट एलिमेंट से जुड़ी है जिसका टाइप ="सर्च" है। यह हमेशा इनपुट खोज तत्व के लिए खोज लौटाएगा।
सिंटैक्स
खोज प्रकार की संपत्ति के लिए वाक्य रचना निम्नलिखित है -
searchObject.type
उदाहरण
आइए इनपुट सर्च टाइप प्रॉपर्टी के लिए एक उदाहरण देखें -
<!DOCTYPE html>
<html>
<body>
<h1>Search type property</h1>
<form>
FRUITS: <input type="search" id="SEARCH1" name="fruits">
</form>
<p>Get the above element type by clicking the below button</p>
<button onclick="getType()">Get Type</button>
<p id="Sample"></p>
<script>
function getType() {
var t = document.getElementById("SEARCH1").type;
document.getElementById("Sample").innerHTML = "The type for the input field is : "+t;
}
</script>
</body>
</html> आउटपुट
यह निम्नलिखित आउटपुट देगा -

"गेट टाइप" बटन पर क्लिक करने पर -
