I would like a Jquery or JavaScript Function that will do when the div display data is less than 30 characters the font-size will be 12px with font-family: Arial and when the div display data is more than 100 characters the font-size is 15px with font-family: Segoe UI else will the default font-size will be 8px.
Your attention is much appreciated.
Please see below:
<style >
.shortstring {
font-size: 18px;
font-family: Arial;
color: #ff6a00;
/*orange*/
}
.longstring {
font-size: 12px;
font-family: Calibri;
color: #4800ff;
/*purple*/
}
</style>
<script type="text/javascript">
window.onload = function () {
LessMore();
}
function LessMore() {
var text = document.getElementById("dvDetails").innerHTML;
if (currentText.length < 25) {
document.getElementById("dvDetails").className = "shortstring";
}
//else
if (currentText.length >= 250) {
document.getElementById("dvDetails").className = "longstring";
}
}
</script>