• js测试题


    <div class="test">

            <h2>测试题</h2>

            <div clss="test_select">
                <div class="test_cont test_on">
                    <h3><span>1/5</span>测试题目11111111111</h3>
                    <p><span></span><input type="radio" name="xuanxiang1" value="1">天气晴</p>
                    <p><span></span><input type="radio" name="xuanxiang1" value="2">天气多云</p>
                    <p><span></span><input type="radio" name="xuanxiang1" value="3">天气阴</p>
                    <p><span></span><input type="radio" name="xuanxiang1" value="4">下雨</p>
                </div>
                <div class="test_cont">
                    <h3><span>2/5</span>测试题目22222222222</h3>

                    <p><span></span><input type="radio" name="xuanxiang2" value="1">天气晴</p>
                    <p><span></span><input type="radio" name="xuanxiang2" value="2">天气多云</p>
                    <p><span></span><input type="radio" name="xuanxiang2" value="3">天气阴</p>
                    <p><span></span><input type="radio" name="xuanxiang2" value="4">下雨</p>
                </div>
                <div class="test_cont">
                    <h3><span>3/5</span>测试题目3333333333</h3>
                    <p><span></span><input type="radio" name="xuanxiang3" value="1">天气晴</p>
                    <p><span></span><input type="radio" name="xuanxiang3" value="2">天气多云</p>
                    <p><span></span><input type="radio" name="xuanxiang3" value="3">天气阴</p>
                    <p><span></span><input type="radio" name="xuanxiang3" value="4">下雨</p>
                </div>
                <div class="test_cont">
                    <h3><span>4/5</span>测试题目44444444444</h3>
                    <p><span></span><input type="radio" name="xuanxiang4" value="1">天气晴</p>
                    <p><span></span><input type="radio" name="xuanxiang4" value="2">天气多云</p>
                    <p><span></span><input type="radio" name="xuanxiang4" value="3">天气阴</p>
                    <p><span></span><input type="radio" name="xuanxiang4" value="4">下雨</p>
                </div>
                <div class="test_cont">
                    <h3><span>5/5</span>测试题目55555555555</h3>
                    <p><span></span><input type="radio" name="xuanxiang5" value="1">天气晴</p>
                    <p><span></span><input type="radio" name="xuanxiang5" value="2">天气多云</p>
                    <p><span></span><input type="radio" name="xuanxiang5" value="3">天气阴</p>
                    <p><span></span><input type="radio" name="xuanxiang5" value="4">下雨</p>
                </div>
            </div>
            <div class="result">您当前的得分是<span></span></div>
        </div>
        <script>
            $(function () {
                var sum = 0;
                var i = 0;
                var len = parseInt($(".test_cont").length);
                $(".test_cont p").click(function () {

                    $(this).find("input").attr("checked", "checked")
                    var b = parseInt($(this).find("input").val());
                    $(this).parent().hide().next().fadeIn(100);
                    sum += b;
                    i++;
                    if (i >= len) {
                        console.log($(".result"));
                        $(".result").show();
                        $(".result span").html(sum + '分');
                    }
                });
            })
        </script>
  • 相关阅读:
    postgresql数据迁移
    编译安装或者mysql启动时遇到的错误小记
    安装数据库时提示重启删除 以下注册信息则不用重启
    ​sql2008安装提示报错,.必须使用"角色管理工具"安装或配置Microsoft.net.framework 3.5 sp1
    windows10 安装jdk13.0.1 与 apache-jmeter-5.1.1
    Axure RP 9 获取验证码发送倒计时
    PHP 重定向跳转页面使用post传参
    用 PHPExcel 导入excel表格并展示到前台
    当失去焦点时 验证时分秒 并提示
    iptables 防止syn ddos ping攻击
  • 原文地址:https://www.cnblogs.com/qianqianj/p/12849593.html
Copyright © 2020-2023  润新知