More simplified solution is as below. Check this out!
var resultString = document.getElementById("theTextBoxInQuestion")
.value
.replace(/^[0]+/g,"");
More simplified solution is as below. Check this out!
var resultString = document.getElementById("theTextBoxInQuestion")
.value
.replace(/^[0]+/g,"");