javascript – if span element value is, how use conditions?-ThrowExceptions

Exception or error:

I have span code:

<span style="width: 93%;">
    <b>93%</b>
<span>

Span have percentage value. I need javascript code when I change this span value below 50% it will show

<p>
    Task completed in **[percent value from span here]**
</p>

else

show this text and hide 2 classes (progress bar and image)

<p>
    **[percent value from span here]** left to complete the task
</p>

Thanks you a lot!

How to solve:

If you are looking for a way to alter CSS or show an hide based on the span value, onchange will be the way to go. This specific part for span with onchange is covered in the following thread:
Trigger for span text/html on changed

Leave a Reply

Your email address will not be published. Required fields are marked *