HTML DOM Input URL name প্রপার্টি একটি স্ট্রিং ফেরত দেয়, যা ইনপুট URL-এর name প্রপার্টির মান যদি সংজ্ঞায়িত থাকে। ব্যবহারকারী এটি নতুন স্ট্রিংয়ে সেটও করতে পারেন।
সিনট্যাক্স (Syntax)
স্ট্রিং মান পাওয়ার জন্য (Returning string value)
inputURLObject.name
name অ্যাট্রিবিউটে স্ট্রিং মান সেট করার জন্য (Setting name attribute to a string value)
inputURLObject.name = 'String'
উদাহরণ (Example)
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>
আউটপুট (Output)
এটি নিম্নলিখিত আউটপুট তৈরি করবে:
'Who is the Owner?' বাটনে ক্লিক করার আগে:

'Who is the Owner?' বাটনে ক্লিক করার পর:
