I don't know what is wrong with my code. I have two elements with an id, and when I click on the corresponding place, the ids are not changed as expected. I have tried to give them values directly as "aaa" or "bbb" to see if it changes it for that, but neither.
I call the js file from the head.
<script src="js/parallax.js"></script>
The html code is as follows:
<div id="destacado-1">
<h2 id="slider-text-1">Slider de texto</h2>
<p id="slider-text-2">Lorem, ipsum dolor sit amet consectetur adipisicing elit. Labore voluptatem impedit ullam itaque reprehenderit.</p>
<div class="botones-slider-text">
<span onclick="sliderOn(0)" href=""><i class="fas fa-circle"></i></span>
<span onclick="sliderOn(1)" href=""><i class="fas fa-circle"></i></span>
<span onclick="sliderOn(2)" href=""><i class="fas fa-circle"></i></span>
<span onclick="sliderOn(3)" href=""><i class="fas fa-circle"></i></span>
</div>
</div>
and my js file is as follows
var sliderText1 = ["Slider titulo uno","Slider titulo dos","Slider titulo tres","Slider titulo cuatro"];
var sliderText2 = [
"Lorem, ipsum dolor sit amet consectetur adipisicing elit. Labore voluptatem impedit ullam itaque reprehenderit.",
"Ipsum lorem dolor sit amet consectetur adipisicing elit. Labore voluptatem impedit ullam itaque reprehenderit.",
"Dolor imput lorem sit amet consectetur adipisicing elit. Labore voluptatem impedit ullam itaque reprehenderit.",
"Sit Lorem, ipsum dolor amet consectetur adipisicing elit. Labore voluptatem impedit ullam itaque reprehenderit."
];
function sliderOn(numero) {
document.getElementsByid("slider-text-1").innerHTML = sliderText1[numero];
document.getElementById("slider-text-2").innerHTML = sliderText2[numero];
}
I have tried changing the span to p or to a button but it still does not work.