首页 > 解决方案 > 协助使用 javascript 功能

问题描述

如果选中了所有复选框,我正在尝试编写代码来激活超链接。下面是我编写的将生成复选框的代码。选中所有复选框后,如何添加启用超链接按钮的功能?


```<head> 
    <title>Check/Uncheck the checkbox using JavaScript</title> 
```</head> 

```<body> 
    <center> 
        <h1 style="color:green">To ensure HIPAA compliance and follow company policy:</h1> 
        <h2>Check the checkbox in order to continue</h2> 
        <form> 
            <div> 
                <input type="button" onclick="checkAll()" value="CHECK ALL"> 
                      </div> 
            <div> 
                <label> 
                    <input type="checkbox" class="check3"> I agree to use no parts of my actual name in ```my screen name. 
                </label> 
            </div> 
            <div> 
                <label> 
                    <input type="checkbox" class="check3"> I agree to not to use open room chat to share ```personal information, knowing that open room chat is visible by all who enter the room. 
                </label> 
            </div> 
            <div> 
                <label> 
                    <input type="checkbox" class="check3"> I agree to provide all personal identifiable ```information to the intake professional and therapist. 
                </label> 
        </div> 
            <div> 
                <label> 
                    <input type="checkbox" class="check3"> I agree to refrain from providing personal ```information of my own or the therapist to other individuals in the lobby. 
                </label> 
            </div> 
        </form> 
    </center> 
```</body> 
```<script type="text/javascript"> 
    //create function of check/uncheck box 
    function checkAll() { 
        var inputs = document.querySelectorAll('.check3'); 
        for (var i = 0; i < inputs.length; i++) { 
            inputs[i].checked = true; 
        } 
    } 
    window.onload = function() { 
        window.addEventListener('load', checkAll, false); 
    } 
```</script> 
  <input type="button" onclick="(https://app.sococo.com/meet/5725dc80632b143d168fbf3155bcddf0)" ```value="Start Your Journey"> 
```</html>

标签: javascriptcheckboxhyperlink

解决方案


推荐阅读