Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

145
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda