Found out selected tab

Found out selected tab

I'm using tabs like this:


I need to perform different tasks depending on which tab is selected.

How can I check which one is selected?