What I want to do is: I have a select
with 5 options
, I want when I select, for example, option1
, go to first section
, when I click option2
go to second section
.
<select>
<option class="primeiraOpcao">Brazil JS</option>
<option class="segundaOpcao">Meetup CSSSP</option>
<option class="terceiraOpcao">Freecodecamp SP</option>
<option class="quartaOpcao">Front in Sampa</option>
<option class="quintaOpcao">Front in BH</option>
</select>
And I have sections
defined so
<section class="alinhamento" id="braziljs">
<section class="alinhamento" id="meetup">
<section class="alinhamento" id="freecodecamp">
<section class="alinhamento" id="frontinsampa">
<section class="alinhamento" id="frontinbh">
And I also have my code in JS, I still just select the options ..
var primeiraOpcao = document.querySelector(".primeiraOpcao");
primeiraOpcao.textContent = "Brazil JS";
var segundaOpcao = document.querySelector(".segundaOpcao");
segundaOpcao.textContent = "Meetup CSSSP";
var terceiraOpcao = document.querySelector(".terceiraOpcao");
terceiraOpcao.textContent = "Freeecodecamp SP";
var quartaOpcao = document.querySelector(".quartaOpcao");
quartaOpcao.textContent = "Front in Sampa";
var quintaOpcao = document.querySelector(".quintaOpcao");
quintaOpcao.textContent = "Front in BH";
JS study a few days ago and I wanted to be able to do this, but I'm not sure how to do it.