Answer the question
In order to leave comments, you need to log in
Conditional construction and value?
Hi. The conditional construct is not working. What is wrong here? Why is the alert not working? It seems that I wrote everything correctly, I don’t understand what’s the matter.
https://jsfiddle.net/s99Lxdw8/3/
Answer the question
In order to leave comments, you need to log in
the button selector is a tag, not a class, and div doesn't have a val() method - input has one
https://jsfiddle.net/L90w5c8o/
1. The handler will not be hung on your button, because the button doesn't have the class you specified in the JS. Remove the dot, or add a class to the button.
2. div cannot have a value, use the data attribute instead: or replace div with<div class="time-wrap" data-value="25"></div>
$('.time-wrap').data('value') == 25
<input type="hidden" value="25">
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question