Good afternoon, I don’t know if I understand very well but this option tag has the parameter Selected that you can mark for whom you want selected.
ex:
<select id="meu-select" tabindex="-1" class="select-large">
<option value="-" selected>[Escolha...]</option>
<option value="[object Object]"> NOME </option>
</select>
View documentation:
https://www.w3schools.com/tags/att_option_selected.asp
if you want to do this in javascript:
// se o value do select ficar igual o value de algum dos option ele será o selecionado
document.getElementById('meu-select').value = '-';
or if you can’t give a field ID you can use for the class it already has:
// lembrando que pela classe podem vir multiplos objetos
document.getElementsByClassName('select-large')[0].value = '-';
I’m wanting to use the script on a game page, so I’m using the tampermonkey extension.. Get this:?
– iniciant0011
try using this second code, right in the browser console on the page in question, in cases like this it is interesting you include in the question the link to be able to play the test.
– Rodolfo Patane
You have not selected anything with this code ... I am creating a script for the game the crims
– iniciant0011
goes to the page in question and opens the browser console, with this javascript code the first select with the class 'select-large' will have selected the first record: Document.getElementsByClassName('select-large')[0]. selectedIndex=0; you can do a for with this javascript to set all page selects with this class
– Rodolfo Patane