- 主题:请教js控制网页元素的两个问题
jquery选择器,可根据css类名访问
https://www.w3school.com.cn/jquery/jquery_selectors.asp
--
FROM 120.244.214.*
缺引号,确认引用jquery库了吧
$(".loginButton>button").click(function() {
//代码写这里
alert("测试");
})
【 在 STEP8 的大作中提到: 】
: 我试了一下,没成功
: 对于:
: <p class="loginButton">
: ...................
--
FROM 120.244.214.*
<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
$(".loginButton>button").click();
【 在 shaolin 的大作中提到: 】
: 你们都从哪确定的这网页上有jquery 。。
: 人要的是trigger不是listener
:
--
FROM 120.244.214.*