jquery works and onclick events fire properly