var totalForDay = parseFloat(twodecimalDomforDay) + parseFloat(twodecimalImportforDay);
totalForDay = totalForDay.toFixed(2);
var totalyearly = parseFloat(twodecimalDomforYearly) + parseFloat(twodecimalImportyearly);
totalyearly = totalyearly.toFixed(2);
badgesData += '<div class="row For-Avg"><div class="col-xs-6 sm-6 md-6 lg-6 left-align"><label class="for-lab">For The Day</label></div><div class="col-xs-6 sm-6 md-6 lg-6 right-align"><label class="year-lab">Yearly Avg</label></div></div><div class="row For-Avg"><div class="col-xs-6 sm-6 md-6 lg-6 left-align"><label class="for-lab-Two">' + totalForDay + '</label></br><div class="border-cls"></div></div><div class="col-xs-6 sm-6 md-6 lg-6 right-align"><label class="year-lab-Two">' + totalyearly + '</label></br><div class="border-cls-Two"></div></div></div></div>';
gasTitle += '<label class="lab-class">' + objKeys[i] + '\n(IN  ' + objkeysData[0].UNIT + ')' + '</label>';
if (parseFloat(totalForDay) < parseFloat(totalyearly)) {
console.info("less yes");
$("div.border-cls").css("border-bottom", "7px solid red");
$("div.border-cls-Two").css("border-bottom", "7px solid green");
//-----border-red for day border-green for yealy
} else {
//-----border-green for day border-red for yealy
console.info("greatre yes");
$("div.border-cls").css("border-bottom", "7px solid green");
$("div.border-cls-Two").css("border-bottom", "7px solid red");
}
Hello Team,
Within the given HTML code stored in badgesData, there is a div element with the CSS class named border-cls. I am seeking assistance on how to update this element based on the condition mentioned in the provided JavaScript code.
Your suggestions and guidance are highly appreciated!