title: $ select dynamic class
body: <p>SOLVED WITH </p>
  
  <pre><code>$('.&lt;?php echo 'render-warp-'.$page-&gt;getIdPage(); ?&gt;').formRender({
                                          formData: JSON.parse(text),
                                          dataType: 'json'
                                      });
  </code></pre>
  
  <p>I have a problem when i want to select a dynamic class and render something. my div class get the id_page like this : </p>
  
  <blockquote>
    <p>class="render-wrap-getIdPage());</p>
  </blockquote>
  
  <p>So in html i get : </p>
  
  <blockquote>
    <p>class="render-wrap-6"</p>
  </blockquote>
  
  <p>Now in my script i need to select the class in order to user my render method. but actualy when i do something like this it doesn't work. </p>
  
  <pre><code>$("#render-warp-" + id).formRender({
                                              formData: JSON.parse(text),
                                              dataType: 'json'
                                          });
  </code></pre>
  
  <p>When i check the inspector i get : </p>
  
  <p>$('.render-warp-' + id).formRender</p>
  
  <p>Anyone know how i could get the id in the selection ? </p>
  
  <p>here the full loop : </p>
  
  <pre><code> &lt;?php foreach ($pages as $page) :?&gt;
  
  
                                  &lt;div id="&lt;?php echo $page-&gt;getIdPage(); ?&gt;" class="render-warp-&lt;?php echo ($page-&gt;getIdPage()); ?&gt;"&gt;&lt;/div&gt;
                                  &lt;script&gt;
                                      jQuery(function($) {
                                          var data = &lt;?php echo (json_encode($page-&gt;getValeur())); ?&gt;;
  
                                          var id = &lt;?php echo ($page-&gt;getIdPage()); ?&gt;;
                                          var text = data.replace(/&amp;quot;/g, '"');
                                          text = text.replace('"\\"[', '[');
                                          text = text.replace(']\\""', ']');
  
                                          $('render-warp-' + id).formRender({
                                              formData: JSON.parse(text),
                                              dataType: 'json'
                                          });
                                      });
                                  &lt;/script&gt;
                              &lt;/div&gt;
  &lt;?php endforeach;?&gt;
  </code></pre>