I’m calling the script below on a button onclick, where .value is a URL dependent on a drop down section. I want the resulting URL to open in a new window (‘_blank’) when the button is clicked. How can I modify this code to do that? Any help is appreciated.
function openResultsPage() {
if(document.getElementById('selectedRace').value){
window.location.href = document.getElementById('selectedRace').value;
}
}
You can try this: