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

105
Views
set option "selected" attribute from dynamically created options

I have a select 3 dynamic select option on the last select option there is always 1 option only

<select class="wpce-field-term" id="wpce-3" data-level="3" data-required="no" data-required-message="" data-type="term">
    <option value="">PCD</option>
    <option value="15437">5x108</option>
</select>

but it is dynamic.

i want to always auto select the first option so i use this

$("#wpce-3 option:nth(1)").attr("selected", "selected");

but the problem is that it is dynamic and the third option is not yet available until select option 1 > select option 2 are selected

about 4 years ago · Santiago Trujillo
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!