How can I have my dropdown selected with an url parameter? I found this: Dropdown selected based on URL parameter - PHP or jQuery?
But it does not work for me. What am I doing wrong? My url would be:
kontakt.php?Betreff=3
script:
var val = location.href.match(/[?&]Betreff=(.*?)[$&]/)[1]; // get params from URL
$('#Betreff').val(val); // assign URL param to select field
and:
<select class="mailstyle" name="Betreff" id="Betreff">
<option value="1">First</option>
<option value="2">Second</option>
<option value="3">Third</option>
</select>