How can I make this shorter? Maybe as a function?

How can I make this shorter? Maybe as a function?

Hi Guys,

Is there any way in which I can shorten this code?:

  1. $(document).ready(function(){

  2.     $(".radio__label").focusin(function(){
  3.         $(this).addClass("focus");
  4.     });

  5.     $(".radio__label").focusout(function(){
  6.         $(this).removeClass("focus");
  7.     });

  8.     $(".checkbox__label").focusin(function(){
  9.         $(this).addClass("focus");
  10.     });

  11.     $(".checkbox__label").focusout(function(){
  12.         $(this).removeClass("focus");
  13.     });

  14.     $(".checkbox__label--error").focusin(function(){
  15.         $(this).addClass("focus");
  16.     });

  17.     $(".checkbox__label--error").focusout(function(){
  18.         $(this).removeClass("focus");
  19.     });

  20. });

Thanks