Amazon Great Indian Festival 2026: 9 Things I'm Waiting to Buy

Image
  Amazon Great Indian Festival 2026: 9 Things I’m Waiting to Buy My personal Amazon sale wishlist — and the prices I’m hoping to see I have a small problem with Amazon sales. I go in looking for one thing. And somehow, 20 minutes later, I'm comparing things I wasn't even planning to buy. This time, though, I actually have a list. The Amazon Great Indian Festival 2026 starts on October 8, and some Early Deals are already live. Amazon is also offering an instant 10% discount on eligible SBI Credit/Debit Card and EMI transactions. Prime members get additional benefits too. So instead of opening Amazon on October 8 and randomly scrolling through thousands of offers, I decided to make my own wishlist beforehand. These are nine things I'm currently watching. Some are useful purchases. Some are things I've been postponing. And one of them is simply something I want. 1. The Game Controller I've Been Putting Off Buying I already have a PC, but I don'...

Best and Easiest Dynamic Year Dropdown using Javascript

 There are many ways to show Year Dropdown on  your page.

1. To hard code the years 

                        <option value="2021">2021</option>

                        <option value="2020">2020</option>

                        <option value="2019">2019</option>

                        <option value="2018">2018</option>

                        <option value="2018">2018</option>

This is not the right approach as code has to be updated after change in year.

2. Adding Year from Database.

This will include creating table showing the years and then writing a query in your code to show the years.

This approach also has limitations as the data has to be updated every year in your table. 


Best Way - The best way is totally automatic which does not include any human intervention after creation of code. 

Javascript Code:

<script type="text/javascript">

                    window.onload = function () {                       

                        var years = document.getElementById("years");                     

                        var currentYear = (new Date()).getFullYear();

                        for (var i = 2021; i <= currentYear; i++) {

                           var option = document.createElement("OPTION");

                            option.innerHTML = i;

                            option.value = i;

                            years.appendChild(option);

                        }

                    };

                </script>

HTML Code:

                    <select name="years" id="years">

                        <option value=""></option>

                        

                        </select>

Add the above code and the dropdown looks like 






Toggle the loop in javascript and the dropdown start from that year itself

Like if you have to tale year of birth, change the javascript 

for (var i = 1950; i <= currentYear; i++) {

the dropdown will be 










Hope this helps.

Comments

Popular posts from this blog

Petrol Vs Diesel Car| Petrol or Diesel Car?? Confused? Read this before buying | India

I still shiver

The Time has Come