title: Run function in current element by get short code inside
body: <p>In stead of adding an ID (IdAddMore) to run script inside ID(widget1) like that :</p>
  
  <pre><code>&lt;div class="widget" id="widget1"&gt;
      &lt;div class="content"&gt;
            &lt;div id="IdAddMore"&gt;&lt;/div&gt;
            &lt;script type='text/javascript'&gt;
            $("#IdAddMore").selectme({
             Numpost:3,
             Postyle : "Enter your style",
             });
            &lt;/script&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><em>(widget is added automatically when I add more new widget, It means I can have widget3, widget10, ....Index(3,10..) is any and is not sorted.)</em></p>
  
  <p>Widget is a HTML/JS widget.</p>
  
  <p>I want run <code>selectme</code> by short code instead of repeating script in each widget.</p>
  
  <pre><code>&lt;div class="widget" id="widget1"&gt;
      &lt;div class="content"&gt;
          [3][mystyle]
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="widget" id="widget50"&gt;
      &lt;div class="content"&gt;
         [4][yourstyle]
      &lt;/div&gt;
  &lt;/div&gt;
  ...........
  </code></pre>
  
  <p>How can I write only script to catch short code in current element is added :</p>
  
  <p>I write script below but it does not work. Check for me, thanks your help.</p>
  
  <pre><code> &lt;script type='text/javascript'&gt;
  var getdata = document.getElementsByClassName(".content").innerText || document.getElementById(".content").textContent;
  var thevalue = [];
  getdata.replace(/\[(.*?)\]/g, function(g0,g1){thevalue.push(g1);});
  
  $(".widget").selectme({
  Numpost:thevalue[0],
  Postyle: ""+thevalue[1]+"",
  });
  &lt;/script&gt;
  </code></pre>