- The fromCharCode() method converts Unicode values into characters.
- This is a static method of the String object, and the syntax is always String.fromCharCode().
Code:-
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>fromCharCode()</h1>
<input type="button" onclick="strfun();" value="Get Answer">
<script>
function strfun()
{
alert(String.fromCharCode(70, 71, 72)); //Return FGH
}
</script>
</body>
</html>
JavaScript from charcode:- Geniusofstudent
Reviewed by Network security
on
June 25, 2019
Rating:
No comments: