I found the capitalized letter which is capitalized with css text-transform:capitalize
was not capitalized when captured by javascript. I wondered what's the easiest way to fix this?
Demo below:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<html>
<input id="box" type="text" style="text-transform:capitalize">
<button id="showinput">type in something then press me</button>
</html>
<script>
$("#showinput").click(function(){
txt=$("#box").val();
alert(txt+" as you can see, the first letter of each word is not capitalized!");
})
</script>