【发布时间】:2014-10-04 14:53:18
【问题描述】:
我已经声明了相同的结构:
<div class="btn-group" data-toggle="buttons" style="margin-left:50px;">
<label class="btn btn-default">
<input id="past5m" type="radio"> 5m
</label>
<label class="btn btn-default">
<input id="past1h" type="radio"> 1h
</label>
</div>
根据this 应该使我能够通过添加来附加onclick 事件:
$(document).ready(function() {
$('#past5m').click(function() {
alert('hello');
});
});
JQuery 已经包含在代码中。
但是,当按下 `#past5m' 时,什么也没有发生。
你能帮我找出错误吗?
谢谢。
【问题讨论】:
-
使用
$(document).ready或$(window).load -
你有没有安装jquery
标签: javascript jquery html twitter-bootstrap