day 1
day 1
<!DOCTYPE html>
<html lang="en">
<head>
<title>Registration</title>
</head>
<body>
<h2>Register</h2>
<button type="submit">Submit</button>
</form>
<script>
function submitForm(e) {
e.preventDefault();
document.querySelector('form').style.display ='none';
document.getElementById('thank-you-message').style.display= 'block';
</script>
</body>
</html>
Login page
*Loginpage.js :
setSubmitted(true); };
return (
{submitted ? (
):(
<form onSubmit={handleSubmit}>
<h2>Login</h2>
<button type="submit">Submit</button>
</form>
)}
</div>
);
};
<Routes>
</Routes>
</Router>
);
}
Feedbackfoam
return (
<Routes>
</Router>
);
*Feedback.js:
import './feedback.css';
};
e.preventDefault();
navigate('/thank');
};
return (
<form onSubmit={handleSubmit}>
<h1>Feedback Form</h1>
<div className="star-rating">
<input
/>
</label>
))}
</div>
</div>
);
};
*thank.js:
import React from 'react';
return (
<div>
<h1>Thank You!</h1>
CS 5
TH SEM
14
Home</button>
</div>
);
};
*feedback.css:
form {
max-width: 400px;
margin: auto;
padding: 20px;
border-radius: 8px;
background-color: #f9f9f9;
h1 {
text-align: center;
margin-bottom: 20px;
font-size: 24px;
color: #333;
input, textarea {
width: 100%;
margin: 10px 0;
padding: 10px;
font-size: 16px;
border-radius: 4px;
box-sizing: border-box;
textarea {
resize: horizontal;
.rating-section {
margin: 15px 0;
.star-rating {
display: flex;
justify-content: space-between;
margin: 10px 0;
.star-rating label {
font-size: 2rem;
color: lightgray;
cursor: pointer;
margin-right: 5px;
}
.star-rating input {
display: none;
.star-rating label.active,
.star-rating label:hover,
color: gold;
button {
width: 100%;
padding: 12px;
margin-top: 20px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
button:hover {
background-color: #0056b3;
Helloworld
console.log(greeting);
exp-4
create a code using React Static and Dynamic, andcreate a code using
React counter( Hookconcept):-*App.js:-
import './App.css';
function App() {
return (
<center>
<Router>
<div className="App">
<nav className="App-nav">
<ul>
<li><Link to="/Login">Login</Link></li>
<li><Link to="/">Home</Link></li>
<li><Link to="/contact">Contact</Link></li>
</ul>
</nav>
<Routes>
</Routes>
</div>
</Router>
</center>
);
*Login.js:-
function Login() {
return (
<form><center>
<h2>Login</h2>
</center>
</form>
);
*about.js:-
function AboutUs() {
return (
<h2>AboutUs</h2>
<p>about us</p>
</div></center>
);
}
*home.js:-
function home() {
return (
<center><h2>Home</h2>
</div>
);
*contact.js:-
function Contact() {
return (
<h2>Contact</h2>
<p>contact details</p>
</center></div>
);
*App.css:-
.App-nav {
background: #333;
color: #fff;
padding: 1rem;
}
.App-nav ul {
list-style: none;
padding: 0;
margin: 0;
display: flex;
.App-nav li {
margin-right: 1rem;
.App-nav a {
color: #fff;
text-decoration: none;
.App-nav a:hover {
text-decoration: underline;