HTML DOM Input URL name प्रॉपर्टी एक स्ट्रिंग लौटाती है, जो इनपुट URL के name प्रॉपर्टी का मान होता है। उपयोगकर्ता इसे एक नई स्ट्रिंग पर भी सेट कर सकता है।
सिंटैक्स
निम्नलिखित सिंटैक्स है:
स्ट्रिंग मान प्राप्त करना
inputURLObject.name
name एट्रिब्यूट को स्ट्रिंग मान पर सेट करना
inputURLObject.name = 'String'
उदाहरण
आइए Input URL name प्रॉपर्टी का एक उदाहरण देखें:
<!DOCTYPE html> <html> <head> <title>Input URL name</title> <style>
form {
width:70%;
margin: 0 auto;
text-align: center;
}
* {
padding: 2px;
margin:5px;
}
input[type="button"] {
border-radius: 10px;
}
</style> </head> <body>
<form>
<fieldset>
<legend>URL-name</legend>
<label for="URLSelect">Employee URL: <input type="url" id="URLSelect" value="https://www.example.com" name="Jack"> </label>
<input type="button" onclick="getName()" value="Who is the Owner? ">
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
var divDisplay = document.getElementById("divDisplay");
var inputURL = document.getElementById("URLSelect");
function getName() {
if(inputURL.value === 'https://www.example.com')
divDisplay.textContent = 'Above URL belongs to '+inputURL.name;
else
divDisplay.textContent = 'Above URL belongs to no one!';
}
</script> </body> </html>
आउटपुट
यह निम्नलिखित आउटपुट उत्पन्न करेगा:
'Who is the Owner?' बटन पर क्लिक करने से पहले:

'Who is the Owner?' बटन पर क्लिक करने के बाद:
