Set relevant global variable based on repeater attribute

I have a repeater.

On click of an item, I want to set a matching global variable.

For example:

  1. Repeater ‘airportCode’ = LBA
  2. Global variable = LBA

eg:

on click:
Global variable = true WHERE global variable == THIS.airportCode

Other i fear i would have to create an object with an onload event and do:

IF ITEM.airportCode == LBA{
Global variable LBA = true
}else if ITEM.airportCode == BFA{

}

and so on for 10 times.

This is just about manegable but if a repeater had 30 or so items…