JSFiddle - React, Tailwind, and code Playground
by irinablue
JavaScript
console.log(JSON.parse([
{
input: {
get: 'value',
where: [
'input.quantity',
'input.amount',
'input.ammount',
'input.qty',
'input[name="qty"]',
'input[name="quantity"]',
'input[name="amount"]',
'input[data-qty]',
'input.pkw-product__input',
'input.pkw-related__counter-input',
'select.quantity',
'select.amount',
'select.ammount',
'select.qty',
'select[name="qty"]',
'select[name="quantity"]',
'select[name="amount"]',
'select[data-qty]',
'select.pkw-product__input',
'select.pkw-related__counter-input',
'[data-product-qty] > input',
'[data-product-quantity]',
'.product-block__add-count select'
],
find: {
from: 'eventTarget',
direction: 'up',
depth: 10
}
}
},
{
input: {
get: 'attribute',
what: [
'data-product-quantity'
],
find: {
from: 'eventTarget',
direction: 'up',
depth: 10
}
}
}
]))