使用 a标签 或 js 群发短信

目录

        • 内容介绍
        • 一、代码
        • 二、效果图

内容介绍

  使用a标签拨打电话、发送邮件、群发短信,js同理,直接上代码。

一、代码



<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用 a标签 或 js 群发短信title>
    <style>
        * {
      
            margin: 0;
            padding: 0;
        }
        
        html,
        body {
      
            width: 100%;
            height: 100%;
            background-color: rgb(255, 255, 255, 0.6);
        }
        
        .cons {
      
            position: fixed;
            top: 10%;
            left: 50%;
            transform: translate(-50%, 0%);
        }
        
        .lists {
      
            min-width: 200px;
            max-width: 60vw;
            margin: 0 auto;
        }
        
        li {
      
            width: 100%;
            list-style: none;
            min-height: 30px;
            line-height: 30px;
            text-align: center;
            font-size: 20px;
            margin-bottom: 20px;
        }
        
        li:nth-of-type(2n+1) a {
      
            color: green;
        }
        
        li:nth-of-type(2n) a {
      
            color: red;
        }
        
        #button {
      
            padding: 5px 15px;
            border-radius: 5px;
        }
    style>
head>

<body>
    <div class="cons">
        <ul class="lists">
            <li><a href="sms:10086">给10086发短信a>li>
            <li><a href="sms:10086?body=qxdy">给10086发短信,内容为"qxdy"a>li>
            <li><a href="sms:10086,10000?body=qxdy">给10086和10000发短信,内容为"qxdy"a>li>
            <li><a href="mailto:[email protected]?subject=testSubject">给某人发邮件,内容为"testSubject"a>li>
            <li><button id="button">给10086打电话button>li>
        ul>

    div>
    <script>
        let button = document.getElementById("button")
        button.onclick = function() {
      
            window.location.href = "tel:10086"
        }
    script>
body>

html>

二、效果图

使用 a标签 或 js 群发短信_第1张图片


使用 a标签 或 js 群发短信_第2张图片


使用 a标签 或 js 群发短信_第3张图片


标签:a标签,拨打电话,发送邮件,群发短信


更多演示案例,查看 案例演示


欢迎评论留言!

你可能感兴趣的:(#,JavaScript,前端)