Java radiobutton if else

时间:2017-01-22 16:08:36

标签: javascript

我目前不熟悉Web开发,如何获取所选单选按钮的总值并将其存储在数组中,然后链接或页面将根据总值而不同。在javascript中有可能吗?让我们说所选按钮的总值为50,然后它将转到第1页,否则它将转到第2页,依此类推。

    <HTML>
    <head>
    <link rel="stylesheet" type="text/css" href="css.css">
    </head>
    <div class="wrap">
    <h1 class="likert-header">Likert Scale survey</h1>
    <form action="">
    <label class="statement">Q1.</label>
    <ul class='likert'>
    <li>
    <input type="radio" name="likert" value="25">
    <label>Strongly agree</label>
    </li>
    <li>
    <input type="radio" name="likert" value="25">
    <label>Agree</label>
    </li>
    <li>
    <input type="radio" name="likert" value="strong_agree">
    <label>Neutral</label>
    </li>
    <li>
    <input type="radio" name="likert" value="-25">
    <label>Disagree</label>
    </li>
    <li>
    <input type="radio" name="likert" value="-25">
    <label>Strongly disagree</label>
    </li>


    </ul>
    <label class="statement">Q2.</label>
    <ul class='likert'>
        <li>
    <input type="radio" name="likert" value="25">
    <label>Strongly agree</label>
    </li>
    <li>
    <input type="radio" name="likert" value="25">
    <label>Agree</label>
    </li>
    <li>
    <input type="radio" name="likert" value="strong_agree">
    <label>Neutral</label>
    </li>
    <li>
    <input type="radio" name="likert" value="-25">
    <label>Disagree</label>
    </li>
    <li>
    <input type="radio" name="likert" value="-25">
    <label>Strongly disagree</label>
    </li>
    </ul>
    <button class="clear">Clear</button>
    <button class="submit">Submit</button>
    </div>
   </form>
   </div>
   </HTML>

0 个答案:

没有答案