frontend editing, show selected category I have this in my edit form

{% set categories = craft.categories.group('jobCategory') %}
    &lt;label for="fields[jobCategory]"&gt;Job Category:&lt;/label&gt;
    &lt;select id="jobCategory" name="fields[jobCategory]"&gt;
        {% for category in categories %}
            &lt;option value="{{ category.id }}"&gt;{{ category.title }}&lt;/option&gt;
        {% endfor %}
    &lt;/select&gt;


but can't for the life of me, show select as 'selected' for the category the entry belongs to.

Missing something simple I'm sure.
Something like the following should work. This assumes that your category field handle is 'jobCategory', and has a limit set to 1.

{% set categories = craft.categories.group('jobCategory') %}
{% set entryCategory = entry.jobCategory.first %}
&lt;label for="fields[jobCategory]"&gt;Job Category:&lt;/label&gt;
&lt;select id="jobCategory" name="fields[jobCategory]"&gt;
    {% for category in categories %}
        &lt;option value="{{ category.id }}" {% if category.title == entryCategory %}selected{% endif %}&gt;{{ category.title }}&lt;/option&gt;
    {% endfor %}
&lt;/select&gt;