HTML implements Double 11 coupon grabbing (set time to open the coupon grabbing page)

HTML implements Double 11 coupon grabbing (set time to open the coupon grabbing page)

Without further ado, I will post the code for you directly. The specific code is as follows:

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <style type="text/css">
        #result{
            width:500px;
            border:1px solid #CCCCCC;
            background:#FFFFCC;
            margin:50px auto;
            font-size:24px;
            color:#FF0000;
            padding:20px;
        }
    </style>
    <script type="text/javascript">
        window.onload = function () {
            showTime();
            var start = document.getElementById("start");
            start.onclick = function () {
                var path = document.getElementById("path").value;
                var time1 = document.getElementById("time1").value;
                var time2 = document.getElementById("time2").value;
                var time3 = document.getElementById("time3").value;
                start.value = "Waiting to open the order grabbing page";             
                setInterval(function () {
                    var date = new Date();
                     var hour = date.getHours();
                     var minute = date.getMinutes();
                     var second = date.getSeconds();
                    if (hour == time1 && minute == time2 && second == time3) {
                        window.open(path);
                    }
                }, 100);
            };       
        }
        function showTime()
        {
             //Create Date object var today = new Date();
             //Get the year, month, day, hour, minute and second respectively var year = today.getFullYear();
             var month = today.getMonth()+1;
             var day = today.getDate();
             var hours = today.getHours();
             var minutes = today.getMinutes();
             var seconds = today.getSeconds();
             //If it is a single number, add 0 in front
             month = month<10 ? "0"+month : month;
             day = day <10 ? "0"+day : day;
             hours = hours<10 ? "0"+hours : hours;
             minutes = minutes<10 ? "0"+minutes : minutes;
             seconds = seconds<10 ? "0"+seconds : seconds;
             //Build the string to be output var str = year+"年"+month+"月"+day+"日"+hours+":"+minutes+":"+seconds;             
             //Get the object with id=result var obj = document.getElementById("result");
             //Write the contents of str into the <div> with id=result obj.innerHTML = str;
             //Delay window.setTimeout("showTime()",1000);
        }
    </script>
</head>
<body>
    <div>
        <h2>1. Synchronize computer time with Beijing time</h2>
        <h2>2. Set the path address to the address and time of the coupon you want to grab</h2>
        <!--<h3>Coupon Address</h3><input type="text" id=path />-->
        <h3>Coupon address (be careful not to miss http:// or https://)</h3> <!--<textarea id="path" style="width:200px;height:80px;"></textarea>-->
        <input type="url" id="path" style="width:auto"/>
        <h3>Ticket grabbing time</h3>
        <input type="text" id=time1 />Hours<input type="text" id=time2 />Minutes<input type="text" id=time3 />Seconds<h2>3, click to wait, then click to grab the coupon</h2>
        <input type="button" id="start" value="Start"/><div id="result"></div>
    </div>
</body>
</html>

Summarize

The above is the HTML implementation of Double 11 coupon grabbing (setting the time to open the coupon grabbing page) introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

<<:  Implementation of CSS Fantastic Border Animation Effect

>>:  MySQL database aggregate query and union query operations

Recommend

MySQL conditional query and or usage and priority example analysis

This article uses examples to illustrate the usag...

Summary of problems encountered in the implementation of Vue plug-ins

Table of contents Scene Introduction Plugin Imple...

Comparison of various ways to measure the performance of JavaScript functions

Table of contents Overview Performance.now Consol...

Detailed example of using typescript to encapsulate axios in Vue3

This axios package is used in the vue3 demo. For ...

Mysql varchar type sum example operation

Some friends, when learning about databases, acci...

React error boundary component processing

This is the content of React 16. It is not the la...

Centos7.5 installs mysql5.7.24 binary package deployment

1. Environmental preparation: Operating system: C...

Vue uses mixins to optimize components

Table of contents Mixins implementation Hook func...

MySQL detailed single table add, delete, modify and query CRUD statements

MySQL add, delete, modify and query statements 1....

Vue implements dynamic query rule generation component

1. Dynamic query rules The dynamic query rules ar...

Complete steps to solve 403 forbidden in Nginx

The webpage displays 403 Forbidden Nginx (yum ins...

How to use Navicat to operate MySQL

Table of contents Preface: 1. Introduction to Nav...