JSFiddle - React, Tailwind, and code Playground

by Alexey Ukolov

HTML

<div class="blocks">
     <div class="block" style="left: 10px; top: 15px;"></div>
     <div class="block" style="left: 10px; top: 25px;"></div>
     <div class="block" style="left: 20px; top: 15px;"></div>
     <div class="block" style="left: 20px; top: 25px;"></div>
</div>

JavaScript

var styles = $('.blocks > .block').map(function() {
  return $(this).attr('style');
}).get();

console.log(styles);