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

195
Visualizações
Way to update specific values in Bootstrap cards

I apologize for the amateur question here, however, I am experiencing some issues with a quick demo website I am creating for a friend.

The purpose of the site is to take the total of all "credit card values", and then divide it by the total amount of "points" there are to arrive at the "points per dollar"

Once that is done, I'd like to multiply the "points per dollar" by the total amount of "points" that are specified in the dropdown menu by the user, and then update all of the cards that have something selected to be the proper math with their point values.

I've successfully done all the math and created functions, but I am unsure how to actually apply it to the specific cards that need it.

I've created functions to do the math, and update the header numbers, just not apply it to the respective cards.

My code can be found here

My website is running on an express.js server with e.js as the templating engine, with bootstrap and jquery.

Any suggestions/help would be very much appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Easiest way to do this is to assign a unique id to each card so that you can write the corresponding data.

Then you can simply do something like:

$(`#${id} .whatever-class-name-for-points-element`).html(points);

It's a bit hard to tell what's going on in your code since it's not a minimum, reproducible example, but assuming you're trying to write one "points" value per employee, you could add id="<%= sm._id %>" or similar to each employee card.

FWIW, you probably want to use the id higher up (like on the card) and then use a data attribute (e.g. data-id="<%= sm._id %>") on the input.

Happy to give you further advice if you create a working, minimal CodePen/CodeSandbox/etc.

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