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

HTML DOM Input Month stepDown() মেথড


HTML DOM Input Month stepDown() মেথড

HTML DOM input month stepDown() মেথড ইনপুট মাস ফিল্ডের মান নির্দিষ্ট পরিমাণ দ্বারা কমায় (decrement করে)।

সিনট্যাক্স

নিচে সিনট্যাক্স দেওয়া হলো:

object.stepDown(number)

এখানে, যদি number প্যারামিটার উপেক্ষা করা হয় তবে এটি মানটি ১ দ্বারা কমায়।

উদাহরণ

Input month stepDown() মেথডের উদাহরণ:

<!DOCTYPE html> <html> <head> <title>HTML DOM stepUp()/stepDown() Demo</title> <style> 
body{ text-align:center; background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) center/cover no-repeat; height:100vh; color:#fff; } 
p{ font-size:1.5rem; } 
input{ width:40%; } 
button{ background-color:#db133a; color:#fff; padding:8px; border:none; width:120px; margin:1rem; border-radius:50px; outline:none; cursor:pointer; } 
</style> </head> <body> 
<h1>stepUp()/stepDown() Method Demo</h1> 
<p>Hi! Select your month of birth</p> 
<input type="month"> 
<br> 
<button onclick="incValue()">StepUp Value</button> 
<button onclick="decValue()">StepDown Value</button> 
<script> 
function incValue() { document.querySelector("input").stepUp(); } 
function decValue() { document.querySelector("input").stepDown(); } 
</script> </body> </html>

আউটপুট

এটি নিচের আউটপুট তৈরি করবে:

HTML DOM Input Month stepDown() মেথড

"StepUp Value" বা "StepDown Value" বাটনে ক্লিক করলে ইনপুট মাস ফিল্ডের মান বৃদ্ধি বা হ্রাস করা যাবে।

HTML DOM Input Month stepDown() মেথড


HTML DOM Input Month stepDown() মেথড


  1. HTML DOM Input DatetimeLocal stepDown() মেথড

  2. HTML DOM Input Time stepDown() মেথড

  3. HTML DOM Input Week stepDown() মেথড

  4. HTML DOM Input Range stepDown() মেথড