Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

336
Vistas
TypeError no capturado: no se pueden leer las propiedades de undefined (leyendo 'getAttribute')

tiene un error Uncaught TypeError: no se pueden leer las propiedades de undefined (leyendo 'getAttribute')

Tengo un sitio web que necesita usar filtros. Ordenar por precio. Pero muestra un error

ingrese la descripción de la imagen aquí

ingrese la descripción de la imagen aquí

 const big_content = document.querySelector('#big_content'); document.querySelector('#sort_low').onclick = function() { low__high('data-price') } document.querySelector('#sort_high').onclick = function() { high__low('data-price') }; function low__high(sortType) { const big_content = document.querySelector('#big_content'); for (let i = 0; i < big_content.children.length; i++) { for (let j = i; i < big_content.children.length; j++) { if (+big_content.children[i].getAttribute(sortType) > +big_content.children.length[j].getAttribute(sortType)) { replaceNode = big_content.replaceChild(big_content.children[j], big_content.children[i]) insertAfter(replaceNode, big_content.children[i]) } } } console.log('Sort by price: low to high'); } function high__low(sortType) { const big_content = document.querySelector('#big_content'); for (let i = 0; i < big_content.children.length; i++) { for (let j = i; i < big_content.children.length; j++) { if (+big_content.children[i].getAttribute(sortType) < +big_content.children.length[j].getAttribute(sortType)) { replaceNode = big_content.replaceChild(big_content.children[j], big_content.children[i]) insertAfter(replaceNode, big_content.children[i]) } } } console.log('Sort by price: high to low'); } function insertAfter(elem, refElem) { return refElem.parentNode.insertBefore(elem, refElem.nextSibling) }
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda