title: Conditional element classes with jinja, I want a div to get a class if a list item contains a certain item
body: <p>I'm making a a little job board and I have little cards for each job. These cards are dynamically created from a list sent from my python script to the html using flask/jinja</p>
  
  <pre><code>jobs = [{'title':'fix car', 'description':'my car broke down', 'price':100}]
  </code></pre>
  
  <p>HTML example</p>
  
  <pre><code>{% for item in jobs %}
  
  &lt;p&gt; {{ item['title'] }} {{ item['description'] }} {{ item['price'] }} &lt;/p&gt;
  
  {% endfor %}
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/1MQ3Z.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1MQ3Z.png" alt="Screenshot of job tasks"></a></p>
  
  <p>What I would like is to be able to make selected cards stand out, or featured. So in my Python script where the jobs come from I've added a binary option. 1 = featured, 0 = normal</p>
  
  <p>So In my html it would look something like this:</p>
  
  <pre><code>{% for item in jobs %}
  
  &lt;p class='featured if item['featured']'&gt; {{ item['title'] }} {{ item['description'] }} {{ item['price'] }}
  
  {% endfor %}
  </code></pre>
  
  <p>so it would get a new CSS class if its featured key is set to 1.</p>
  
  <p>CSS example</p>
  
  <pre><code>.featured {
      background-color: blue;
  }
  </code></pre>