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

HTML DOM Input Button type Property

HTML DOM ইনপুট বাটনের type প্রপার্টি বাটনের টাইপ রিটার্ন করে অর্থাৎ এটি "button", "submit" বা "reset" টাইপের কিনা তা জানায়।

সিনট্যাক্স

object.type

উদাহরণ

<!DOCTYPE html> <html> <head> <title>HTML DOM type Property</title> <style>    body{       text-align:center;    }    .btn{       display:block;       margin:1rem auto;       background-color:#db133a;       color:#fff;       border:1px solid #db133a;       padding:0.5rem;       border-radius:50px;       width:40%;    }    .show-type{       font-weight:bold;       font-size:1.4rem;       color:#ffc107;    } </style> </head> <body> <h1>type Property Example</h1> <input type = "submit" onclick = "getType()" class = "btn" value = "Click me to know about my type"> <div class="show-type"></div> <script>    function getType() {       var btnType = document.querySelector(".btn").type;       document.querySelector(".show-type").innerHTML = btnType;    } </script> </body> </html>

আউটপুট

নিচের আউটপুটটি দেখাবে:

HTML DOM Input Button type Property

"Click me to know about my type" বাটনে ক্লিক করলে ইনপুট বাটনের টাইপ দেখাবে।

HTML DOM Input Button type Property

  1. HTML DOM Input Reset type প্রোপার্টি

  2. HTML DOM ইনপুট সার্চ type প্রপার্টি

  3. HTML DOM ইনপুট সাবমিট type প্রপার্টি

  4. HTML DOM Input Radio type প্রোপার্টি