java script to view current time
Shivam Malviya
@Intern at Sunderkiran Management Services | CSE-AIML(2026)|Creator of ResultShodh & MyUpasthiti Website???| AI & ML Enthusiast??| Full-Stack Developer??| Passionate Innovator??| Open to Collaborations & Opportunities??
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>shivam malviya</title>
<style>
h1{
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
font-size: 25px;
max-width:400px;
position: relative;
text-align: center;
background: linear-gradient(red,gold,skyblue);
color:rgb(16, 31, 198);
border: 3px solid black;
border-radius: 50px 20px 30px 40px;
}
p{
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
font-size: 20px;
max-width:400px;
position: relative;
text-align: center;
background: linear-gradient(red,skyblue);
color:rgb(32, 35, 33);
border: 3px solid black;
border-radius: 50px;
}
button{
margin-left: 100px;;
background-color: aqua;
border: 2px solid red;
border-radius: 50px;
}
button:hover{
cursor: pointer;
background-color: red;
}
</style>
</head>
<body>
<h1>Simple Java Script code for show current time </h1>
<button type="button" onclick="document.getElementById('time').innerHTML=Date()">click here to view time</button>
<p id="time"></p>
</body>
</html>
save this file with file_name.html
than check the output-
领英推荐