The guys have done the finishing touches left ... I'm trying to reveal the optiona value by this method
$('#select option:eq(3)').val("new values") but nothing happens ...
The guys have done the finishing touches left ... I'm trying to reveal the optiona value by this method
$('#select option:eq(3)').val("new values") but nothing happens ...
It seems everything was written correctly, your code works for me. Can you also change the option text?
$( document ).ready(function() { $('#select option:eq(3)').val("new values"); $('#select option:eq(3)').html("new values"); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <select id = 'select'> <option value = '1'>1</option> <option value = '2'>2</option> <option value = '3'>3</option> <option value = '4'>4</option> <option value = '5'>5</option> </select> Source: https://ru.stackoverflow.com/questions/618278/
All Articles
selected, but in the question itself there is no such thing. This code should potentially be the 4thoptionchild for the element with the identifier#selectto change the value ofvalue. - teranselected? In the answer below, everything works. - teran