Jump to content
Fórum Script Brasil
  • 0

Javascript ler span (como fazer)


HardY-

Question

Preciso fazer um javascript aqui, que colete os dados de uma span com id='calc' dentro de uma td, cada td possui 3 span, preciso de somar o valor delas, e fazer um if, se soma valor < 800 td.parentNode.style.display = 'none';

Aqui esta um exemplo da td

<td style="text-align: center;">

<span class="calc">7<span class="grey">.</span>51</span> .<span class="calc">3<span class="grey">.</span>53</span>.<span class="calc">5<span class="grey">.</span>55</span>

</td>

precisaria que ele ignorasse o span class grey, e só somasse os númerais. e depoissomasse todos os 3 blocos e se resultado fosse > que 800 dar o display none.

alguma ideia? :wub:

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...