Optimice multiple window.location.href = "index.html" : I have multiples IDs in my HTML. When I click that element (.onclick) I want to redirect them all (window.location.href) to the same site.


So far I have tried this code but doesn't works:

document.getElementById("boxed", "inmerse", "flow", "scape", "fierce", "name6", "name7", "name8", "name9").onclick = () => window.location.href = "../3infoCardPremium/3infoCardPremium.html"

This is the code that works

```javascript
document.getElementById("boxed").onclick = () => window.location.href = "../3infoCardPremium/3infoCardPremium.html"

document.getElementById("immerse").onclick = () => window.location.href = "../3infoCardPremium/3infoCardPremium.html"


document.getElementById("flow").onclick = () => window.location.href = "../3infoCardPremium/3infoCardPremium.html"


document.getElementById("scape").onclick = () => window.location.href = "../3infoCardPremium/3infoCardPremium.html"


document.getElementById("fierce").onclick = () => window.location.href = "../3infoCardPremium/3infoCardPremium.html"


document.getElementById("name6").onclick = () => window.location.href = "../3infoCardPremium/3infoCardPremium.html"


document.getElementById("name7").onclick = () => window.location.href = "../3infoCardPremium/3infoCardPremium.html"


document.getElementById("name8").onclick = () => window.location.href = "../3infoCardPremium/3infoCardPremium.html"


document.getElementById("name9").onclick = () => window.location.href = "../3infoCardPremium/3infoCardPremium.html"
```

I'm expecting to create some function or another way to optimize the code.