开发者

Won't work Check All button [duplicate]

This question already has answers here: Closed 11 years ago.

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.

http://jsfiddl开发者_JAVA百科e.net/KbkZk/1/

Sorry lol, been a long day!!


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:

<script>
$(document).ready(function() {
    ... your code here ...
}):
</script>

If you're not using a JS library, you can do mostly the same thing with:

<body onload="myFunction();">

and have that myFunction do your initialization/setup.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜