I think I’m missing something really obvious here… must be… but for some reason I can’t get my progressbar to display a value that’s set in an attribute!
here’s my html:
<div class="progressBar" data-value="58"></div>
and js:
$(function () {
$('.progressBar').each(function () {
$(this).progressbar();
//var value = $(this).attr('data-value');
//alert(value);
$(this).progressbar('option', 'value', $(this).attr('data-value'));
});
});
It displays the bar, but doesn’t show any value (i.e. value = 0). If I hardcode a value into the js, it shows fine. If I uncomment the var value and alert line, I get an alert with the value. What am I missing??
You must parse your attr as int :