I'm trying to call percentValue from CSS #number1 and have it run in the function in place of the absolute number which can usually be found after "percent":. I'm not really sure how it works and any help would be amazing.
(function($) {
$(function() {
var percentValue = document.getElementById('number1');
/* thermometers with config */
$('.thermometer').thermometer({
percent: percentValue,
speed: 'slow'
})
});
})(jQuery);
Updated Code (Answered)
(function($) {
$(function() {
var percentValue = $('#number1').text()
/* thermometers with config */
$('.thermometer').thermometer({
percent: percentValue,
speed: 'slow'
})
});
})(jQuery);
#number1? You should select it via jQuery ($('#number1')) and use eitherval()ortext()on it. Currently you're passingpercenta DOMElement which isn't going to work. Also note the closure is redundant in this case.