How to pass properties to Component that has DOM modifed by jscript?

I just want to add that the way i added the javascript is based on the thread Best practice to include external javascript libraries i.e. #50568 which IMHO does not really clarify the way how pure javascript libraries should be included. I consider the current solution as hack.