JavaScript
$.each(['#clk','#clk1'], function()
{
$(this).click(function () {
alert("click")
});
});
HTML
<a href="#" id="clk">click me</a>
<a href="#" id="clk1">click me</a>
No alert box when the link is clicked.
UPDATE:
I have more than 1 id. I have shown only one to simplify the problem.
You will have to use
String.toString()to get the value of theStringobject.It´s not clear why you would need an array of selectors but here are two solutions;
Your solution using
String.toString();Alternative solution using
String.join();
See my demo.
If you don´t really need the array of selectors I would recommend a simple multiple selector like this;