Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • TypeScript Tutorial
  • TS Exercise
  • TS Interview Questions
  • TS Cheat Sheet
  • TS Array
  • TS String
  • TS Object
  • TS Operators
  • TS Projects
  • TS Union Types
  • TS Function
  • TS Class
  • TS Generic
Open In App
Next Article:
Print ASCII Value of a Character in JavaScript
Next article icon

Unicode Character Value Finder App Using TypeScript

Last Updated : 04 Feb, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

The Unicode Character Value Finder Project in TypeScript aims to develop a tool that allows users to easily find the Unicode value of any given character. This system helps in understanding and working with special characters, ensuring accuracy in encoding, and improving text processing tasks.

What We Are Going to Create

We’ll build an application that allows users to

  • Enter a character in an input field.
  • Find the Unicode value of the entered character.
  • Display the Unicode value dynamically as the user types.
  • Provide visual feedback for the entered character's Unicode value.

Project Preview

Unicode-value-7
Unicode Character Value Finder using TypeScript

Unicode Character Value Finder - HTML and CSS Setup

This HTML code creates a simple Unicode Character Value Finder. It allows users to enter a character and displays its Unicode value. This CSS code provides styling for the Unicode Character Value Finder, ensuring a clean, centred design with modern touches like padding, rounded corners, and shadow effects.

HTML
<html> <head>     <style>         body {             font-family: Arial, sans-serif;             background-color: #f9f9f9;             display: flex;             justify-content: center;             align-items: center;             height: 100vh;             margin: 0;         }         .container {             text-align: center;             background: #fff;             padding: 20px;             border-radius: 8px;             box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);             width: 300px;         }         h1 {             font-size: 24px;             color: #333;         }         input {             width: 80%;             padding: 8px;             font-size: 16px;             margin-top: 10px;             border: 1px solid #ccc;             border-radius: 4px;         }         button {             margin-top: 15px;             padding: 10px 20px;             background-color: #4caf50;             color: white;             border: none;             border-radius: 4px;             cursor: pointer;         }         button:hover {             background-color: #45a049;         }         .result p {             margin-top: 20px;             font-size: 18px;             color: #555;         }     </style> </head> <body>     <div class="container">         <h1>Unicode Character Value Finder</h1>         <label for="char">Enter a Character:</label>         <input type="text" id="char" maxlength="1" placeholder="A" />         <button id="getUnicode">Get Unicode</button>         <div class="result">             <p id="unicodeValue">Unicode:</p>         </div>     </div> </body> </html> 

In this example

  • The input field allows character entry with a placeholder.
  • The result display shows the Unicode value dynamically.
  • The button triggers the logic to find the Unicode value.
  • CSS centers the form, adds padding, rounded corners, and a shadow.
  • Styles the input and button with padding, hover effects, and a user-friendly appearance.

Task Management App - Typescript Logic

This TypeScript code handles the task management logic for the app. It allows users to add, edit, and delete tasks, as well as mark tasks as completed. The code ensures that the task list is dynamically updated, providing a seamless and interactive user experience.

JavaScript
function val(char: string): string {     if (char.length !== 1) {         return "Please enter a single character.";     }     return `Unicode: U+${char.charCodeAt(0).toString(16).toUpperCase()}`; }  const inp = document.getElementById("char") as HTMLInputElement; const display = document.getElementById("unicodeValue") as HTMLParagraphElement; const btn = document.getElementById("getUnicode") as HTMLButtonElement;  btn.addEventListener("click", () => {     const char = inp.value;     const unicode = val(char);     display.textContent = unicode; }); 

In this example

  • This TypeScript code handles the core task management logic for the app.
  • It allows users to add, edit, and delete tasks.
  • Users can also mark tasks as completed.
  • The code ensures the task list is dynamically updated, offering a smooth and interactive experience.

Convert to JavaScript File

Now You need to convert the TypeScript file into JavaScript to render by browser. Use one of the following command-

npx tsc task.ts
tsc task.ts
  • The command tsc task.ts compiles the calculator.ts TypeScript file into a task.js JavaScript file.
  • It places the output in the same directory as the input file by default.

Complete Code

HTML
<html> <head>     <style>         body {             font-family: Arial, sans-serif;             background-color: #f9f9f9;             display: flex;             justify-content: center;             align-items: center;             height: 100vh;             margin: 0;         }         .container {             text-align: center;             background: #fff;             padding: 20px;             border-radius: 8px;             box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);             width: 300px;         }         h1 {             font-size: 24px;             color: #333;         }         input {             width: 80%;             padding: 8px;             font-size: 16px;             margin-top: 10px;             border: 1px solid #ccc;             border-radius: 4px;         }         button {             margin-top: 15px;             padding: 10px 20px;             background-color: #4caf50;             color: white;             border: none;             border-radius: 4px;             cursor: pointer;         }         button:hover {             background-color: #45a049;         }         .result p {             margin-top: 20px;             font-size: 18px;             color: #555;         }     </style> </head> <body>     <div class="container">         <h1>Unicode Character Value Finder</h1>         <label for="char">Enter a Character:</label>         <input type="text" id="char" maxlength="1" placeholder="A" />         <button id="getUnicode">Get Unicode</button>         <div class="result">             <p id="unicodeValue">Unicode:</p>         </div>     </div>     <script>         function val(char) {             if (char.length !== 1) {                 return "Please enter a single character.";             }             return "Unicode: U+".concat(char.charCodeAt(0).toString(16).toUpperCase());         }         var inp = document.getElementById("char");         var display = document.getElementById("unicodeValue");         var btn = document.getElementById("getUnicode");         btn.addEventListener("click", function () {             var char = inp.value;             var unicode = val(char);             display.textContent = unicode;         });     </script> </body> </html> 



Next Article
Print ASCII Value of a Character in JavaScript

S

sneha2dmo
Improve
Article Tags :
  • JavaScript
  • Web Technologies
  • TypeScript
  • TypeScript-Projects

Similar Reads

  • Get Unicode Character Value in JavaScript
    Here are various ways to get Unicode character values in JavaScript 1. Using charCodeAt() to Get Unicode ValuesThis code defines a string letter containing the character "A". It then uses the charCodeAt() method to get the Unicode value of the first character (index 0) and logs the result, which is
    5 min read
  • JavaScript Application - Get Unicode Character Value
    A Unicode Character Value is a unique numeric identifier assigned to every character in the Unicode standard. It allows consistent text representation in computers, regardless of the platform, device, or language. What We Are Going to CreateWe will build a simple web application where users can inpu
    4 min read
  • Print ASCII Value of a Character in JavaScript
    ASCII is a character encoding standard that has been a foundational element in computing for decades. It is used to define characters in a computer. There is a huge table of ASCII values. To print the values in JavaScript In this post, we print the ASCII code of a specific character. One can print t
    2 min read
  • How to convert Unicode values to characters in JavaScript ?
    The purpose of this article is to get the characters of Unicode values by using JavaScript String.fromCharCode() method. This method is used to return the characters indicating the Unicode values. Description: Unicode is a character encoding standard that assigns a unique number to every character,
    2 min read
  • Calculator App Using TypeScript
    A calculator app is a perfect project for practising TypeScript along with HTML and CSS. This app will have basic functionalities like addition, subtraction, multiplication, and division. It provides a clean and interactive interface for the user while using TypeScript to handle logic safely and eff
    6 min read
  • TypeScript Defining a Union Type
    In this article, we are going to learn about Defining a Union Type in Typescript. TypeScript is a popular programming language used for building scalable and robust applications. In TypeScript, a union type allows a variable to have one of several possible types. You can define a union type by using
    3 min read
  • Quiz App Using Typescript
    A quiz app built with TypeScript provides an interactive way to test knowledge while using TypeScript’s strong typing for better code quality. By implementing features like multiple-choice questions, score tracking, and timers, we can create a robust and engaging quiz experience for users. What We’r
    7 min read
  • Iterate Over Characters of a String in TypeScript
    Iterating over characters of a string involves going through them one by one using loops or specific methods. This is useful for tasks like changing or analyzing the content of a string efficiently. Example:Input: string = "Hello Geeks"; Output: H e l l o G e e k sBelow listed methods can be used to
    4 min read
  • How to Derive Union Type From Tuple/Array Values in TypeScript ?
    This article will show how to derive union type from tuple/array values in TypeScript language. The union type in TypeScript is mainly formed by combining multiple types. We will see various approaches through which we can derive union type. Below are the possible approaches: Table of Content Using
    2 min read
  • Check if a variable is a string using JavaScript
    Checking if a variable is a string in JavaScript is a common task to ensure that the data type of a variable is what you expect. This is particularly important when handling user inputs or working with dynamic data, where type validation helps prevent errors and ensures reliable code execution. Belo
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences