title: When pass multiple parameters onclick event not working. Why?
body: <p>The button create dynamically having <code>onclick</code> event, it working fine when I pass a single reference variable <strong>this</strong>, but at the time when I pass multiple parameters by <code>onclick</code> event, it is not working. Guide me on what I am doing wrong? I tried the following code:</p>
  <p><strong>Button Create script</strong></p>
  <pre><code>$(document).on('change','.typeOption',function(){
      labelVal=$(this).closest('tr').find('input').val();
      console.log(labelVal);
      if($(this).val() == 'radio' || $(this).val() == 'select'){
          $(this).closest('tr').after(&quot;&lt;button type='button' class='btn btn-block createOptionBtn' onclick='createOptions(this,'&quot;+labelVal+&quot;')'&gt;&lt;i class='fa fa-plus'&gt;&lt;/i&gt; Add Option&lt;/button&gt;&quot;);
      }
  });
  </code></pre>
  <p>Pass value to this function:</p>
  <pre><code>function createOptions(e,myval){
      $(e).parent().parent().find('.row').show();
      console.log(myval);
      $(e).parent().parent().find('.row').append('&lt;div class=&quot;col-md-4&quot; style=&quot;margin-bottom:10px&quot;&gt;'+
              '&lt;div class=&quot;input-group&quot;&gt;'+
                '&lt;input type=&quot;text&quot; class=&quot;form-control&quot; placeholder=&quot;Enter option...&quot; &gt;'+
                '&lt;span class=&quot;input-group-addon&quot; onclick=&quot;removeOption(this)&quot;&gt;&lt;i class=&quot;fa fa-trash-o&quot;&gt;&lt;/i&gt;&lt;/span&gt;'+
              '&lt;/div&gt;'+
        '&lt;/div&gt;');
  }
  </code></pre>