JSFiddle - React, Tailwind, and code Playground

by Kirubel Girma

HTML

<input type="number" id="numCom">

JavaScript

function numberWithCommas(x) {
    return x.toString().replace(/\B(?<!\.\d*)(?=(\d{3})+(?!\d))/g, ",");
}

function TextChanged(y){
		var txt_val =  document.getElementById("numCom").value
    
}
document.getElementById("numCom").addEventListener("change", );