{% if opt.is_default(q) %}
    {% set selected = "selected" %}
{% endif %}
<option id="{{ opt.key }}" name="{{ q.key }}" value="{{ idx }}" {{ selected }} {{ opt_attrs | safe }}>
    {{ opt.label | safe }}
</option>