码迷,mamicode.com
首页 > Web开发 > 详细

js测试题

时间:2020-05-08 18:40:03      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:ons   parse   hide   NPU   试题   value   find   ext   bsp   

<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>

js测试题

标签:ons   parse   hide   NPU   试题   value   find   ext   bsp   

原文地址:https://www.cnblogs.com/qianqianj/p/12849593.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!