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

168
Views
How to use select with redirect to display content on the page

I would like to know how to get the select values and redirect them to display content on the page

In the example below, the redirect to another page is done, but I wanted the main content to be static and only display the javascript content below

JavaScript

    <script>
           function AbrirSecao(secao){
               window.open(""+secao+"", "_parent");
           }
    </script>

HTML

    <select name="unidade" id="unidade" onChange="AbrirSecao(this.value)">
        <option value="">Selecione sua Cidade</option>
        <option value="http://www.google.com.br">Sua Cidade 1</option>
        <option value="http://www.google.com.br">Sua Cidade 2</option>
    </select>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can do it and you'll display the value of option in then paragraph tag with content ID:

function AbrirSecao(secao) {
  let display = document.getElementById('content')
  display.textContent = secao
}
<p id="content"></p>
<select name="unidade" id="unidade" onChange="AbrirSecao(this.value)">
  <option value="">Selecione sua Cidade</option>
  <option value="http://www.google.com.br#one">Sua Cidade 1</option>
  <option value="http://www.google.com.br#two">Sua Cidade 2</option>
</select>

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!