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

221
Visualizações
what does @ do in an elements id tag javascript/php and how can i reference this element

Junior dev working on a website and got thrown by how to reference this element

<div class="form-group">
                  <label for="@id-name">Name</label>
                  <input id="@id-name" class="form-control" name="name" required type="text" max-length="70" value="{{$userBot->name ?? null}}">
</div>

I was adding the maximum length cap and wanted to create an alert when this limit was reached. I was expecting the solution to look something like this

$( '#@id-name' ).on('input', function() {
                                    if ($(this).val().length>70) {
                                        alert('you have reached the maximum characters for bot name');
                                    }
                                });

but, not entirely to my surprise, this doesn't seem to be able to get the element to reference, and I tried some variations between jquery and javascript and different "" positionings to no success. I know the site uses php, my assumption is this is a part of that language (php isn't my area of expertise, my role is mostly ux integrations like this alert)

I'm curious how more experienced developers would create a reference to an element with an @ in the id.

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