java script to view current time

java script to view current time

Shivam Malviya

<!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-

Before onclick ????
After Onclick ????


要查看或添加评论,请登录

Shivam Malviya的更多文章

  • Quize_creator

    Quize_creator

    you can check full code here???????? Shivam Malviya

  • Linear_search

    Linear_search

    you can check code here????????

  • QRCODE

    QRCODE

    view full details here ????????

  • Function

    Function

    YOU CAN VISIT OUR WEBSITE ??????

  • PYTHON JOURNEY

    PYTHON JOURNEY

    See my website??????

社区洞察

其他会员也浏览了