title: Getting attribute value by parent class name
body: <p>I have a slider, and on swipe I am trying to get the attribute value of the centered element. my js doesn't seem to work. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>owl.on('changed.owl.carousel', function(event) {
    var a = document.getElementsByClassName("owl-item active center").children("item").attr("data-price");
    console.log(a);
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="owl-item active center" style="width: 340px; margin-right: 0px;"&gt;
    &lt;div class="item" data-price="200" data-name="Car 2" data-color="Green"&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>