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.prototype.find.call(
document.querySelectorAll('.table-item__name'),
n => n.textContent === team
);
return el ? +el.closest('tr').children[3].textContent : null;
}
const wins = getWinCount('Уфа');
Мой браузер не поддерживает ES-2015
function getWinCount(team) {
var teams = document.querySelectorAll('.table-item__name');
for (let i = 0; i < teams.length; i++) {
var el = teams[i];
if (el.textContent === team) {
while ((el = el.parentNode).tagName !== 'TR') ;
return +el.children[3].textContent;
}
}
return null;
}