Last active
August 28, 2020 21:30
-
-
Save adrianjguerrero/0a4baaab435e0469f07f57219fc965ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert('CLICK SOBRE LA IMAGEN DEL PRODUCTO A EDITAR') | |
document.querySelectorAll('td.image').forEach(el=>el.addEventListener('click',function(e){ | |
var nombre = e.target.parentElement.parentElement.querySelector('td.name').textContent | |
let precio = prompt('INGRESA PRECIO TAL COMO LO COPIASTE DEL DOC') | |
precio = precio.replace('$','').replace(',','.').trim() | |
var others = [...document.querySelectorAll('td.name')].filter(el=>el.textContent===nombre).map(el=>el.parentElement.querySelector('.cell_input')) | |
others.forEach(el=>{ | |
el.querySelector('input').value = precio | |
el.style.backgroundColor = 'cyan' | |
}) | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment