0
What I want to do is this: I have a select
with 5 options
, I want when I select, for example, option1
, go to first section
, when I click on 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 the sections
thus defined
<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 also I have my code in JS, still just selected 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";
I’ve been studying JS for a few days and I wanted to be able to do it, but I’m not sure how to do it..
That "goes to" would move the page to the
section
in question?– Woss
Yes, the page is at the top, so select moves up to the Section!
– Richard Manzoli