How ethical to use Javascript libraries that are available on the net?

I want to do something with JavaScript on my website but don’t know how to implement it, but i’ve found it has already been written by someone and is available to download free as they’ve put it on net.

So is it right morally to use something that someone has already been written? does this count as cheating? does it infringe any copyright?

<snip>

Did they put it on the net for others to download, or are you talking about JavaScript that just happens to exist on someone’s own website and they don’t mean to be giving it away? The first case is absolutely fine (jQuery, Scriptaculous/Prototype, etc.) while the second case (yanking JavaScript off someone’s site) is illegal.