Js&Ts
Js&Ts
1. Create a class named Emp with following attribute name, id, salary & displayInfo
method provide access code for the same.
4. Create an object called person with properties name, age, and gender. Access
and log the name property to the console.
7. Create a Form with Fields for Username, Age, and Password. Implement JavaScript
Validation to Ensure:
a. Username contains only alphanumeric characters.
b. Age is a number greater than 18.
c. Password should have a minimum length of 8 characters, including at least
one uppercase letter, one lowercase letter, and one digit..
8. Write JavaScript Code to Validate a Registration Form with Fields for First Name,
Last
Name, and Phone Number:
a. First Name and Last Name should contain only alphabetic characters.
9. Create a Form with Fields for Address, City, and email. Use JavaScript to Implement
Validation That Checks:
a. Address should not be empty.
b. City should only contain letters.
c. Email should contain a valid format.
Typescript
1. Create a Class Manager with Attributes name, id, salary, department, and a Method
to Display Manager Information.