Pick up Label Div Daughter Value

Asked

Viewed 74 times

-1

$(".Linha").on('click', function(){
   // Como pegar o Valor da Parcela ao Clicar na Div
    
});
     // Como pegar o Valor da Parcela ao Clicar na Div

  <div class="Linha row align-vertical" style="height: 389px; overflow: auto;" >
                            <!-- RECEBE DIVS DINAMICAS -->
           <div class="table" style="border: 1px solid; border-color:#E6E6E6; 
                margin:10px; width:200px; height:350px; text-align:center;"> 
                Valor da Parcela</label><br><label id="1" 
                Class="dp1">111.567</label> 
           </div>
           <div class="table" style="border: 1px solid; border-color:#E6E6E6; 
                margin:10px; width:200px; height:350px; text-align:center;"> 
                Valor da Parcela</label><br><label id="2" 
                class="dp1">141.967</label> 
           </div>
  </div>

  • You can take the value of label for his id or for your class, but already I say that your question will probably be closed, because there are already several similar questions like yours of how to capture text, value, etc... here on the site.

  • 1

    Because you’re closing a label be have it open: Valor da Parcela</label>?

  • Can’t find a question what I need, why open it. The Examplo you went through doesn’t answer me. More Anyway Thank you. I’ll look somewhere else.

1 answer

0


$('.Linha').on('click', () => {
  const productContent = document.querySelectorAll('.dp1')
  const price = []
  
  for(let i = 0; i < productContent.length; i++){
    price.push(productContent[i].firstChild.textContent)
  }
})

Browser other questions tagged

You are not signed in. Login or sign up in order to post.