js get element by attribute
//find first element with "someAttr" attribute
document.querySelector('[someAttr]')
js get element by attribute
//find first element with "someAttr" attribute
document.querySelector('[someAttr]')
javascript document get by attribute
priceChange(price, prefix, key, id) {
if (prefix === '+' && parseInt(price) > 0) {
this.price_print = (parseInt(this.originalPrice) + parseInt(price)).toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
} else if (price !== null) {
this.price_print = parseInt(this.originalPrice).toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
}
document.querySelectorAll('[id_attr="attr' + key + '"]').forEach(function (el) {
el.classList.remove('product__storage__item-active');
});
document.getElementById('value_option' + id).classList.add('product__storage__item-active');
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us