title: JavaScript all elements which id starts with an interpolated string
body: <p>I have some buttons with the same class <code>.btn-plus-minus</code> and an id that starts with &quot;btn-plus-SomeMoreText_1_[...]&quot;.</p>
  <p>To select all buttons, I used <code>var buttons = $(&quot;.btn-plus-minus[id^='btn-plus-']&quot;);</code></p>
  <p>But now I don't want all buttons, but only these that also match a number.
  My <code>match[1]</code> returns &quot;SomemoreText_1_&quot; and I want only the buttons with ids starting with btn-plus-SomeMoreText_1_ so I tried:</p>
  <pre><code>var plusButtons = $(&quot;.btn-plus-minus[id^=`btn-plus-${match[1]}`]&quot;);
  </code></pre>
  <p>Unfortunately, the string interpolation inside the <code>id^=...</code> doesn't seem to work since I get the following exception:</p>
  <blockquote>
  <p>Uncaught Error: Syntax error, unrecognized expression: .btn-plus-minus[id^=<code>btn-plus-${match[1]}</code>]</p>
  </blockquote>
  <p>Is there another way to achieve what I want?</p>
  <p>Thanks in advance</p>