HTML DOM ইনপুট মাসের মান বৈশিষ্ট্য ফেরত দেয় এবং একটি ইনপুট মাস ক্ষেত্রের মান বৈশিষ্ট্যের মান পরিবর্তন করে৷
সিনট্যাক্স
নিচের সিনট্যাক্স −
-
রিটার্নিং মান
object.value
-
2. মান পরিবর্তন করা
object.value = true | false
উদাহরণ
আসুন HTML DOM ইনপুট মাস ভ্যালু প্রপার্টি-
এর একটি উদাহরণ দেখি<!DOCTYPE html>
<html>
<head>
<style>
html{
height:100%;
}
body{
text-align:center;
color:#fff;
background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%)
center/cover no-repeat;
height:100%;
}
p{
font-weight:700;
font-size:1.1rem;
}
input{
display:block;
width:35%;
border:2px solid #fff;
background-color:transparent;
color:#fff;
font-weight:bold;
padding:8px;
margin:1rem auto;
}
.btn{
background:#0197F6;
border:none;
height:2rem;
border-radius:2px;
width:35%;
margin:2rem auto;
display:block;
color:#fff;
outline:none;
cursor:pointer;
}
.show{
font-size:1.5rem;
color:#db133a;
font-weight:bold;
}
</style>
</head>
<body>
<h1>DOM Input month value property Demo</h1>
<p>Hi, Select any month for your holiday</p>
<input type="month" class="monthInput">
<button type="button" onclick="getValue()" class="btn">Click me to show
value</button>
<div class="show"></div>
<script>
function getValue() {
var monthInput = document.querySelector(".monthInput");
document.querySelector(".show").innerHTML = " "+ "Value = " +
monthInput.value + "";
}
</script>
</body>
</html> আউটপুট
এটি নিম্নলিখিত আউটপুট −
তৈরি করবে

যেকোনো মাস নির্বাচন করুন এবং তারপরে “মান দেখানোর জন্য আমাকে ক্লিক করুন-এ ক্লিক করুন " নির্বাচিত মান প্রদর্শন করতে বোতাম৷
