Because Javascript can run in the browser without the assumption that you completely trust it, browser developers have put a load of work into restricting what it can do, even within the browser. Of course, sometimes there are holes in the sandbox - nothing is perfect - but I think it's vastly better than giving any program you decide to run complete access to your computer.
(Better for the majority, that is. If you're truly paranoid and have enough time, explicitly deciding what to trust can be better. But I think that's <1% of people - certainly not including me.)