var str = '{"success":1,"items":{"Orb of Deliverance":{"price":36.8,"appid":"570"},"Planks of the Bogatyr":{"price":0.2,"appid":"570"},"Virulent Matriach":{"price":921.27,"appid":"570"}}}';
var obj = JSON.parse(str);
var price = obj.items['Planks of the Bogatyr'].price;
console.log(price);
let search = 'Уфа',
commands = document.querySelectorAll('.table-item__name'),
command = [...commands].find(x => x.textContent === search),
row = command.closest('tr'),
cells = row.querySelectorAll('td'),
result = cells[3].textContent
var search = 'Уфа',
result = Array.from(document.querySelectorAll('.table-item__name'))
.find(x => x.textContent === search)
.closest('tr')
.querySelectorAll('td')[3].textContent
function getWinCount(team) {
const el = Array
.from(document.querySelectorAll('.table-item__name'))
.find(n => n.textContent === team);
return el ? +el.closest('tr').children[3].textContent : null;
}
const wins = getWinCount('Уфа');
Мой браузер не поддерживает ES-2015
function getWinCount(team) {
var el = null;
[].concat.apply([], document.querySelectorAll('.table-item__name')).forEach(function(n) {
if (!el && n.textContent === team) {
el = n;
}
});
if (!el) {
return null;
}
do {
el = el.parentNode;
} while (el.tagName !== 'TR');
return +el.children[3].textContent;
}