title: How to select the last div based on attribute
body: <p>I have this html code:</p>
  
  <pre><code>&lt;div id="mydiv"&gt;
      [other divs]
      &lt;div data-day="1"&gt;content&lt;/div&gt;
      [other divs with data-day attribute]
      &lt;div data-day="random"&gt;content&lt;/div&gt;
      [other divs]
  &lt;/div&gt;
  </code></pre>
  
  <p>I wanna select the last element in the mydiv that has data-day attribute. How can I do this?</p>
  
  <pre><code>#mydiv div[data-day]:last-child
  </code></pre>
  
  <p>I tried this, but it didn't work.</p>