“检查全部”按钮不起作用
Possible Duplicate:
Select All Checkbox
I have the follow code for a Check All button that will check all my checkboxes on my webpage, but it's not working. Where is the function supposed to go? Because I've tried putting the code on my page but it doesn't work.
Sorry lol, been a long day!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
什么代码?通常,您将 JS 放在页面的
块中。如果 JS 将操作页面的内容,则需要延迟其执行,直到加载页面的其余部分。在 jquery 中,您可以使用:
如果您没有使用 JS 库,则可以使用以下命令执行几乎相同的操作:
并让 myFunction 执行初始化/设置。
What code? Generally you put your JS in the
<head>
block of your page. If the JS will be manipulating the page's contents, you'll need to delay its execution until the rest of the page is loaded. In jquery, you do that with:If you're not using a JS library, you can do mostly the same thing with:
and have that myFunction do your initialization/setup.