/app.js Secret
Created
November 17, 2021 08:26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Hitung huruf kapital dalam JavaScript</title> | |
</head> | |
<body> | |
Enter some text: <br> | |
<input type="text" id="textbox"> | |
<button onclick="count()"> | |
<br> | |
<script type="text/javascript"> | |
function count(){ | |
var mytext= document.getElementById("textbox").value; | |
var numUpper = (mytext.match(/[A-Z]/g) || []).length; | |
alert(numUpper); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment