I want to convert the textarea input value to a string, but does not work and output is: [Object HTMLInputElement], I've used regex, it works properly when I hard code a string
let input = document.getElementById("input").toString();
let result = input.replace(/(?<=(?:^|[.?!])\W*)[a-z]/g, i => i.toUpperCase());
console.log(result);
Via Active questions tagged javascript - Stack Overflow https://ift.tt/YcnQmzt
Comments
Post a Comment