Hi Jan,
To get more knowledge to implement JavaScript in Mendix specifically, I can advise you to read this article:
https://world.mendix.com/display/Tutorials/Widgets+-+Mx+JavaScript+Reference+Guide
To learn JavaScript, there is a nice and play and learn tutorial here:
http://www.codecademy.com/en/tracks/javascript