I am hiding divs until a specific amount of time has passed, at which I am attempting to tell jQuery to show a specific div with the corresponding time.
HTML
<div class="content">
<div class="item" value="00:15">
<p>Some text</p>
</div>
<div class="item" value="00:30">
<p>More text</p>
</div>
<div class="item" value="01:00">
<p>Even more text</p>
</div>
</div>
JS
$('.content').children().hide();
// some timer function returning timeElapsed
var myTime = '01:00';
if (timeElapsed == myTime) {
$('.item').attr('value', myTime).show();
}
What's happening is all the .item
divs are showing when the if statement is triggered, instead of the one specified by var myTime
. What needs to be changed?