কম্পিউটার টিউটোরিয়াল

HTML DOM Input URL name প্রপার্টি

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?' বাটনে ক্লিক করার আগে:

HTML DOM Input URL name প্রপার্টি

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

HTML DOM Input URL name প্রপার্টি

  1. HTML DOM Input URL required প্রপার্টি

  2. HTML DOM Input URL readOnly প্রপার্টি

  3. HTML DOM Input URL placeholder প্রপার্টি

  4. HTML DOM Input URL pattern প্রপার্টি