First at all I will explain what I mean:
I had two files index.html and searchDomain.html so I want to open de other file with a window.open(searchDomain.html); in this file i got this:
<select id="menu" name="tld" class="form-control">
<option value=".com">
.com
</option>
<option value=".com.mx">
.com.mx
</option>
<option value=".mx">
.mx
</option>
</select>
I don't know how to change the <select> option value with the URL.
Example URL: 127.0.0.1/searchDomain.html
So the desire result would be the select option value on .com.mx
This is the desire url
This is the desire result from previous url

if there is a JS or any function to do it.
wen a click a link on index.html get redirected to searchDomain.html?selectid=menu&value=.com.mx to change the value of the <select id="menu"> <option value=".com.mx>
Emil Moe
Senior Data Engineer
Do you need to take the value from the select and use it in your context? You can do that by using
getElementByIdas you have an id associated:let menu = document.getElementById('menu') let tld = menu.options[menu.selectedIndex].value window.open('searchDomain.html?...&value='+ tld)You should make a check if nothing has been selected. My assumption is that selectedIndex will be
-1or maybe0.