Oops! It appears that you have disabled your Javascript. In order for you to see this page as it is meant to appear, we ask that you please re-enable your Javascript!

Program of ASCII character values in javascript JS with form values entered by the user.

Program of ASCII character values in javascript JS with form values entered by the user.

In this tutorial, we will try to learn the followings;

  1. Flowchart of  ASCII character values.
  2. Program of ASCII character values in javascript JS. 
  3. ASCII character values in javascript JS with form values entered by the user.

Flowchart of  ASCII character values.

ASCII character values in javascript JS with flowchart

Figure: ASCII character values in javascript JS with the flowchart

Program of ASCII character values in javascript JS. 

Note: This program will find the ASCII value of only last character.

<html>
<body>

<h2>Conversion of a character into its <strong>ASCI</strong></h2>
<p>This program will show the asci of the character assigned in the program</p>

<button onclick="myFunction()">click here</button>
<p id="demo"></p>
<script>
function myFunction(){
var char='a';
var n=char.charCodeAt();

document.getElementById("demo").innerHTML=n;
}
</script>

</body>
</html>

ASCII character values in javascript JS with form values entered by the user.

Note: This program will find the ASCII value of only last character.

<html>
	<head>
		<title>My Frist Js Assignment</title>
		<script>
			function printAsscii(event){
				var x = event.keyCode;
				document.getElementById("result").innerHTML = "The ASCI value is: " + x;
				
			}	
		</script>
	</head>
	<body>
		<div>
			<h2>Character Conversion </h2>
			<p>System will return asci code of the most recent character entered by user.</p>
			<form>
				<input style="height: 39px;
    padding: 5px;
    border: 1px solid #cccc;
    width: 226px;" type="text" id="input_field" onkeypress="printAsscii(event)" placeholder="Enter Any Character"  />
				<br />
				<br />
				<label><b>Result</b></label>
				<br />
				
				<div id="result"></div>
					
			</form>
		</div>
		
	</body>
</html>

 

Topic Covered

javascript program to find the length of a string. 
  List of All Programs of Javascript : Click Here 
.

Fazal Rehman Shamil Click Here to Know More
Instructor, Researcher, Blogger, SEO Expert, Poet and Publisher of International Journal Of Software, Technology & Science ISSN : 2616 - 5325
Dear Professors and Resarchers!You are welome to Cite these tutorials in your research or slides etc. Please don't forget to mention the reference of website. Copy Paste of text is strcitly forbidden. Images can be reuse because images are protected with watermark.

One Reply to “Program of ASCII character values in javascript JS with form values entered by the user.”

Leave a Reply

Your email address will not be published. Required fields are marked *