How prevent posting malicious code ?

How can I prevent new registered users posting any JavaScript codes or something dangerous for network users ?