Use element attribute instead of localStorage for passing trainNo value