Heat oil in a large deep frying pan. Add onions and garlic; cook, covered, over low heat for about 30 minutes, stirring occasionally, until soft.
Stir in mustard seeds and cook a further 1 minute.
Add sugar, vinegar and salt. Bring to the boil, reduce heat; simmer, uncovered, stirring occasionally, for about 5 minutes, or until most of the liquid has evaporated and the onions are caramelised.
Spoon mixture into hot sterilised jars; seal while hot. Keep refrigerated.

Dining and Cooking