Search the blog

The following code will change the window location from a select change using jQuery. Note that due to popup blockers you cannot open the page in a new window.

The HTML:


<select class="location-changer">
	<option value="https://www.texelate.co.uk/">Home page</option>
	<option value="https://www.texelate.co.uk/me">Me</option>
</select>

The jQuery:


$('select.location-changer').on('change', function() {
	
    window.location = $(this).val();	
	
});

Tim Bennett is a Leeds-based web designer from Yorkshire. He has a First Class Honours degree in Computing from Leeds Metropolitan University and currently runs his own one-man web design company, Texelate.