key trains by id in js