Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Dropdown menu for alphabets

Hi I am creating a dropdown list on HTML. I know you can create via the option method:

<select name ="letter" id="letter">
 <option value="a">A</option>
 <option value="b">B</option>
 <option value="c">C</option>
 <option value="d">D</option>
(... to Z)
</select>

I was wondering if there was any other methods to construct a dropdown menu for letters ? I have seen it done with jquery was wondering if there was any method with javascript? thank you

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

jQuery is a library for JavaScript, so everything that you can do with jQuery, you can also do with vanilla JavaScript.

You could do that like this:

const selectHtmlElement = document.querySelector("#letter");

const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

for(let letter of alphabet ){
  let optionHtmlElement = document.createElement("option");
  optionHtmlElement.value = letter.toLowerCase();
  optionHtmlElement.textContent = letter;
  selectHtmlElement.appendChild(optionHtmlElement);
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!