美文网首页
jQuery索引值

jQuery索引值

作者: 栀心_d553 | 来源:发表于2020-01-03 08:28 被阅读0次

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jQuery索引值</title>
    <style type="text/css">
        .list li{
            height: 30px;
            margin-bottom: 10px;
            background-color: gold;
        }
    </style>
    <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $('.list li').click(function(){
                // alert(this.innerHTML);//弹出标签中的内容
                alert($(this).index());//弹出下标
            })
        })
    </script>
</head>
<body>
    <ul class="list">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
        <li>7</li>
        <li>8</li>
    </ul>
</body>
</html>

相关文章

  • jQuery(二)

    jQuery索引值: jQuery做选项卡: jQuery属性操作: jQuery特殊效果: $('.box')....

  • jQuery操作 及动画效果

    jQuery样式操作 click事件 jQuery索引值 jQuery做选项卡 jQuery属性操作 jQuery...

  • jQuery操作 及动画效果

    jQuery样式操作 click事件 jQuery索引值 jQuery做选项卡 jQuery属性操作 jQuery...

  • jQuery操作 及动画效果

    jQuery样式操作 click事件 jQuery索引值 jQuery做选项卡 jQuery属性操作 jQuery...

  • jQuery基本操作

    jquery选择器 选择集转移 click事件 jquery索引值 jquery选项卡 jQuery属性操作

  • 前端笔记14

    jQuery选择器 选择集转移 jQuery的样式操作 click事件 jQuery索引值 jQuery作选项卡 ...

  • jQuery索引值

  • 前端(十五)2

    1.jQuery加载 2.jQuery选择器 3.jQuery样式操作 4.jQuery索引值 5.jQuery做...

  • 前端(jQuery)

    jQuery选择器 jQuery样式操作 click事件 jQuery索引值 选择集转移 jQuery做选项卡 j...

  • jQuery方法以及事件

    jQuery索引值 jquery特殊效果 jquery链式调用 jquery对象的方法会在执行完后返回这个jque...

网友评论

      本文标题:jQuery索引值

      本文链接:https://www.haomeiwen.com/subject/ivoaoctx.html