I have a code here but the code for disabling the button is not working.
Button with link
<button id="link-button">
<a id="link-web" href="" style="text-decoration:none">GO TO LINK</a>
</button>
Select Option
<select id="website" onchange='selecWeb(this)'>
<option>Search Engine</option>
<option value="https://google.com">Google</option>
<option value="https://yahoo.com">Yahoo</option>
<option value="https://bing.com">Bing</option>
</select>
JS Code
function selecWeb(a){
var val = a.value;
if(a.options[a.selectedIndex].text== "Search Engine")
{
$('#link-button').prop('disabled', true);
}
else
{
$('#link-button').prop('disabled', false);
document.getElementById('link-web').href = val;
}
}
Why prop('disabled', true) is not working?
Is there another way?