[jQuery] Cambiar opción de un elemento select.

Vamos a cambiar la opción seleccionada de nuestro select con jQuery, la nueva opción la sacaremos de un strong
HTML:

<form action="" method="post">
    <select id="nuestroId">
      <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>

  <strong id="nuevaOpcion">5</strong>
</form>

 

jQuery:

$('#nuestroId').val($('#nuevaOpcion').outerText);

 

PandaGG
Lok'tar ogar

Dejar respuesta

Please enter your comment!
Please enter your name here

Sponsor

Últimos

Themenslots mit Ägypten Motiv

EinführungThemenslots mit Ägypten Motiv sind ein faszinierendes Segment der Online-Spielautomaten, das die reiche Kultur und Geschichte Ägyptens in den Mittelpunkt stellt. Diese Spielautomaten sind...

Yabby Casino Customer Support: How Players Can Get Help with Account and Payment Questions

IntroductionIn the world of online gaming, customer support plays a crucial role, especially for beginners navigating platforms like Yabby Casino. Understanding how to access...

Casino en ligne retrait express : Guide complet pour les parieurs expérimentés

IntroductionLe monde des jeux d'argent en ligne a évolué de manière significative ces dernières années, et le concept de retrait express est devenu un...

Royal Panda Casino Review for Canadian Players

IntroductionRoyal Panda Casino has emerged as a popular online gaming destination for players in Canada. With its user-friendly interface and a wide variety of...

Exploring the Different Gaming Categories Available on Roobet

IntroductionRoobet is an online gaming platform that has gained popularity among players in Canada. It offers a variety of gaming categories that cater to...