How to use variable in selector field?

How to use variable in selector field?

I am new to Jquery.
 
Is it possible to use variables instead of selectors? If yes can anyone help me please?
For example, instead of #list2, #list3 at the code below is it possible?
 
$(function(){
 $("select").change(function() {
  var selectedAttr = this.getAttribute("id")
  var convid = $(this).val();


  if (selectedAttr=="list1"){
   $('#list3').empty();
  }
   
  $.ajax({
  type: "POST",
  url: "handTodb1.asp",
  data: "convid=" + convid,
  success: function(ajaxResponse) {
   
   var temp = convid.split("-")
   var contid= temp[1]










   if(contid==1){  
   $('#list2').html(ajaxResponse);
   }
   else if(contid==2){  
   $('#list3').html(ajaxResponse);
   }
   else if(contid==3){  
   $('#list4').html(ajaxResponse);
   }
  }
  });
 });
});