JSFiddle - React, Tailwind, and code Playground
HTML
<strong class="weight-800">800 KG</strong>
CSS
#populate {
border: 1px solid red;
}
JavaScript
jQuery(document).ready(function () {
$('[class^="weight"]').each(function () {
var usingMetric = false;
var $this = $(this);
var value = this.className.split('-')[1];
if (usingMetric) {
$this.text(value + " KG");
}
else {
value = parseFloat(value) * 2.20462262; // Convert to imperial
$this.text(value + " lbs");
}
});
});