0
I’m starting to learn Javascript, and would like someone to help me solve the following problem: I made a simple character counter but it starts counting from 0, is there a way to start counting from 1?
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>Título da página</title>
<meta charset="utf-8">
</head>
<body>
<input type="text" onkeypress="contador()">
<p>
</p>
<script>
function contador(){
var c = document.getElementsByTagName("input")
var result = c[0].value.length
var cont = document.getElementsByTagName("p")
cont[0].innerText = result
}
</script>
</body>
</html>