How to place a variable value within a selector? (Dynamic ID values)

How to place a variable value within a selector? (Dynamic ID values)

Hello all. 
I have the following that works just fine. If the div ID includes the string "targetDiv" then alert.
  1.              $("div[id*='targetDiv']").click(function(){
  2. alert("found the div");
  3. });


Now I would like to make the string for which it searches dynamic. I tried this

  1. var idTarget = "targetDiv";
  2.              $("div[id*=idTarget]").click(function(){
  3. alert("found the div");
  4. });

I am replacing the hardcoded string value of "targetDiv" with the variable of idTarget whose value is "targetDiv"

Is this possible? What is the syntax?

Thanks so much.
Rich