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

342
Views
¿Cómo obtener el texto puro y la opción seleccionada en una etiqueta p?

Después de seleccionar 5 y 2, ¿hay alguna solución para obtener una salida de cadena como: 5 mayor que 2?

 <p class="showTxt" id="showTxt"> <select size="2"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> <p> greater than</p> <select size="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> </p>

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

0

¿Es esto lo que quieres?

 function showText(ele) { document.getElementById("2").innerHTML = document.getElementById("1").options[document.getElementById("1").selectedIndex].text+" is greater than "+ele.options[ele.selectedIndex].text; }
 <p class="showTxt" id="showTxt"> <select size="2" id="1"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> <p> greater than</p> <select size="1" onchange="showText(this)"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> </p> <p id="2"></p>

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!