Reputation: 3384
At this website: http://www.salus.si/en (if you click on "change" in top banner*) the select element starts with an empty option. HTML looks like this:
<select id="cc-preference-selector-analytics">
<option value="yes">I accept</option>
<option value="no">I do not accept</option>
</select>
Here is the same select element in jsfiddle: http://www.jsfiddle.net/JG89n - which shows the first option. Why is this happening?
Thanks.
**If you have "Send do not track headers" enabled in your browser, you wont see the banner. Its a cookie consent banner which doesn't get displayed if user has this feature enabled. IE10 has it enabled by default. Banner looks like this (top of the page): *
Upvotes: 1
Views: 395
Reputation: 18064
You haven't set the default option, so it displays empty.
If you want default selection as "I accept", do this way:-
<select id="cc-preference-selector-analytics">
<option value="yes" selected="selected">I accept</option>
<option value="no">I do not accept</option>
</select>
Mostly like, this is a browser behaviour and also I think your javascript can also cause this issue.
Upvotes: 1