Treat target as CSS selector instead of ID, and fix trim call