社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
私信  •  关注

ellipsis

ellipsis 最近创建的主题
ellipsis 最近回复了
6 年前
回复了 ellipsis 创建的主题 » 如何使用Jquery隐藏/显示表中列出的按钮之一?

您可以在不同的元素上使用相同的类名,而不是相同的id

$(".test1").click(function() {
  $(this).siblings(".test2").slideToggle("slow", function() {
    // Animation complete.
    $(".test2").show()
  });
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<html>

<head>
</head>

<body>
  <table>
    <tr>
      <th>Actions</th>
    </tr>
    <tr>
      <td>
        <input type="submit" name="test1" class="test1" value="TEST1" /><br/>
        <input style="display: none;" type="submit" name="test2" class="test2" value="TEST2" /><br/>
      </td>
    </tr>
    <tr>
      <td>
        <input type="submit" name="test1" class="test1" value="TEST1" /><br/>
        <input style="display: none;" type="submit" name="test2" class="test2" value="TEST2" /><br/>
      </td>
    </tr>
  </table>
</body>

</html>

你用错了密码。参考 this

$(function() {
  $(document).keyup(function(e) {
    if (e.which == 49) {
      console.log('1');
      window.location.href = '/';
    } else if (e.which == 50) {
      window.location.href = '/escolas';
    } else if (e.which == 51) {
      window.location.href = '/noticias';
    } else if (e.which == 52) {
      window.location.href = '/eventos';
    } else if (e.which == 53) {
      window.location.href = '/contato';
    }
  });
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
6 年前
回复了 ellipsis 创建的主题 » 如何使用jquery的$.post()发送头?

这就行了。

$.post({
     url: 'xyz',
     headers: { 'header': 'value' }
});
6 年前
回复了 ellipsis 创建的主题 » 无法对特定h1标记应用带有jquery的css

使用 hasClass jquery的功能。如果有问题的元素是否有特定的类,则返回布尔值。

if($("p").hasClass('ABC')) { $(".b,h1").css({'color': 'red'}); }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="b" > <h1>Hello</h1> <div class="a"> 
 <p class="ABC">A........Z</p> 
</div>
</div>