element based triggers for frontend javascript