Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var o = {
- categorias: document.querySelectorAll(".categorias-tmc"),
- productos: document.querySelectorAll("#productos-tmc div"),
- cat: null,
- }
- var m = {
- inicio: function(){
- for(var i = 0; i < o.categorias.length;i++){
- o.categorias[i].addEventListener("click", m.seleccion)
- }
- },
- seleccion: function(e){
- o.cat = e.target.getAttribute("cat"),
- console.log(o.cat)
- }
- }
- m.inicio();
Add Comment
Please, Sign In to add comment