add/remove classes to 100 span tags (one at at time) using a single button
For the HTML I have
- <span id="one">Vestibulum </span> <span id="two">tortor</span> <span id="three">quam,</span>
for the JS I have
- $("button").toggle(
function () {
$("span").removeClass("big");
$("#one").addClass("big");
},
function () {
$("span").removeClass("big");
$("#two").addClass("big");
},
function () {
$("span").removeClass("big");
$("#three").addClass("big");
},
- );
this cycles through and does what i need, however i have like 100 span tags ... is there a way to do this without having to identify every span ID ?