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

127
Vistas
Difference between let eventEl = $("#" + rowId + "textarea"); and let eventEl = $("#" + rowId + " textarea");?

Basically, the code creates a "scheduler" of sorts using JS for an assignment. I spent hours troubleshooting why the code below wasn't correctly saving information to local storage. I was able to isolate the error to a specific function within my code.

Once I did that, then I went down each line of code and tried everything to see what would fix the error. Turns out, adding a space before textarea in let eventEl = $("#" + rowId + "textarea"); fixed it for some reason.

In other words, let eventEl = $("#" + rowId + " textarea"); works fine, but the previous one doesn't.

Can anyone help explain why?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

A space is the descendant combinator in CSS. If you did not add the space, you would be looking for an element with the id of rowId concatenated with "textarea" rather than a textarea contained inside the element with id of rowId.

The descendant combinator — typically represented by a single space (" ") character — combines two selectors such that elements matched by the second selector are selected if they have an ancestor (parent, parent's parent, parent's parent's parent, etc) element matching the first selector. Selectors that utilize a descendant combinator are called descendant selectors.

about 4 years ago · Juan Pablo Isaza Denunciar
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