JSFiddle - React, Tailwind, and code Playground

by mbarinov

HTML

<ul>
    <li rel="address">рыбинская</li>
    <li rel="phone">1234567</li>
    <li rel="name">Вася</li>
    <li rel="summ">100 р</li>
    <li rel="description">Описание</li>
</ul>
<button>Push!</button>

JavaScript

$('button').click(function() {
    var info = new Object;
    var client = $(this).parent().find("ul li").each(function(index) {
        info[$(this).attr("rel")] = $(this).text();
    });
    console.log(info);
});