Is there a reason this location.assign does not work?

Is there a reason why the click does not open the page?

<td data-label="Vehicle"><input id="b40112" type="button" value="#40112" class="buttonCar" aria-label="Go to yellow page"></td>

const btn40112 = document.getElementById("b40112");
function b40112(){
	window.location.assign("https://www.website.com/parts/search/?query=40112");
}
btn40112.addEventListener('click',b40112);
const btn40112 = document.getElementById("b40112");

btn40117.addEventListener('click',b40112);

// should be ?
btn40112.addEventListener('click',b40112);

True, but it was my typo.

It still doesn’t work that way. There’s no browser console message to say why the page does not open.

Sorry. There was a semi-colon missing earlier in the page. Fixed.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.