document.head . का उपयोग करें दस्तावेज़ के
टैग की आईडी प्राप्त करने के लिए जावास्क्रिप्ट में संपत्ति। document.head . को लागू करने के लिए आप निम्न कोड को चलाने का प्रयास कर सकते हैं जावास्क्रिप्ट में संपत्ति -
<!DOCTYPE html>
<html>
<head id = "myid">
<title>JavaScript Example</title>
</head>
<body>
<h1>Employee Information</h1>
<form>
Name: <input type = "text" name = "name" value = "Amit"><br>
Subject: <input type = "text" name = "sub" value = "Java">
</form>
<script>
var a = document.head.id;
document.write("<br>Head element id? "+a);
</script>
</body>
</html>