Input URL size प्रॉपर्टी इनपुट URL के लिए size प्रॉपर्टी को प्राप्त/सेट करती है। यदि परिभाषित नहीं है, तो यह प्रॉपर्टी '20' लौटाती है।
सिंटैक्स
निम्नलिखित सिंटैक्स है:
size एट्रिब्यूट प्राप्त करना
inputURLObject.size
size प्रॉपर्टी को नंबर पर सेट करना
inputURLObject.size = number
उदाहरण
आइए Input URL size प्रॉपर्टी का एक उदाहरण देखें:
<!DOCTYPE html> <html> <head> <title>Input URL size</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-size</legend>
<label for="URLSelect">URL: <input type="url" id="URLSelect" size="10"> </label><br>
<input type="button" onclick="increaseVisibility()" value="Increase Visibility">
<div id="divDisplay"></div>
</fieldset>
</form>
<script>
var divDisplay = document.getElementById("divDisplay");
var inputURL = document.getElementById("URLSelect");
function increaseVisibility() {
inputURL.size = 30;
divDisplay.textContent = 'Visibility Increased to '+inputURL.size;
}
</script> </body> </html>
आउटपुट
यह निम्नलिखित आउटपुट उत्पन्न करेगा:
'Increase Visibility' बटन पर क्लिक करने से पहले:

'Increase Visibility' बटन पर क्लिक करने के बाद:
