Skip to content Skip to sidebar Skip to footer

How To Add Style On Javascript Condition

I have a file with html and javascript. It show sum of values against arabic alphabets entered in text box. You can check sample by entering text like ا ب ج د ح و ز then it

Solution 1:

This is what you need? It's just matter of html/css styling

const sum = 23671;

document.getElementById("hijri").innerHTML = '<h2><div class="resultbox">Value of your text is</div><div class="resultbox redbox">'+sum+'</div></h2>';
#hijri {
  font-family: 'Trebuchet MS', Arial;
}
.resultbox {
  float: left;
  padding: 20px;
}
.redbox {
  background-color: red;
}
<divid="hijri"></div>

Post a Comment for "How To Add Style On Javascript Condition"