Saved X
Google login
SignUp with Email
X

Javascript string length

theindreshverma ( Edited  Sep 29, 05:55 pm )
Login

Javascript str.length method

<html>
<head>
    <title>Javascript string length</title>
</head>
<body>

<h1>Javascript string length</h1>

<p id="s"></p>
<input type="text" onkeyup="getLen(this)" placeholder="Enter here" />

<script>
function getLen(t) {
    var x = document.getElementById('s');
    
    x.innerHTML = t.value.length;
}
</script>

</body>
</html>

Sourcecode Tags

More Sourcecodes

More Sourcecodes