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

219
Views
How to change multiple same name input element in Wordpress post with jQuery?

I can change Wordpress input element with different name. As for example the following input element:

<input class="wpProQuiz_button" type="button" value="Start Quiz" name="startQuiz">

can be changed with the following jQuery code:

jQuery("input[name='startQuiz']").attr("value", "Start Mock Test");

Question:

How can I do the same for the following with same name input element in Wordpress?

<input type="button" name="next" value="Next" class="wpProQuiz_button wpProQuiz_QuestionButton" style="float: right;">

<input type="button" name="next" value="Quiz-summary" class="wpProQuiz_button wpProQuiz_QuestionButton" style="float: right;">

I have use the following for the above two input element like :

jQuery("input[name='next']").attr("value", "Next");
jQuery("input[name='next']").attr("value", "Test-summary");

But it is not working. How can I do this?

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

0

use jQuery selectors:

jQuery("input[name='next']:first-child").val("zzzz"); jQuery("input[name='next']:nth-child(2)").val("qqqqq");

and take in mind "float:right" :)

more examples here: https://api.jquery.com/category/selectors/child-filter-selectors/

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!