I have a numeric sequence from 0 to 99:
0 1 2 3 4 5 . . . 99
In this case, i'm trying to put some numbers in bold after clicking a button. For example, within a first input there is the number 2 and within a second input there is the number 99, and after clicking on a button, the number 2 and 99 are in bold as below:
0 1 2 3 4 5 . . . 99
I tried to find some similar questions, but unfortunatly i didn't find some solution to improve my script yet:
I Want To Print 1 to 100 Numbers Using Arrays In Javascript Only
How to format numbers by prepending 0 to single-digit numbers?
At first i'm trying with the following HTML code and a jquery script to apply this solution, but i'm not able to improve it to get the final result:
HTML code:
<input type="number" id="field1" value="2"/>
<br>
<input type="number" id="field2" value="99"/>
<br>
<button type="button" id="getBtn">show me the highlighted numbers</button>
<br>
<div id="sequence"></div>
Jquery script to call click event:
$('#getBtn').on( "click", function() {
var field1 = $('#field1').val();
var field2 = $('#field2').val();
// From this point, i don't know how to improve the script to display a sequence number with the highlighted numbers.
for(let i = 0;i <= 100;i++){
console.log(i);
}
$("#sequence").html();
});
How can i improve my script to find a viable solution?