title: pass variable from javascript function to controller method in codeigniter
body: <p>I'm new in CodeIgniter. I am making a project in which I make a javascript function in view an in this I define a variable .. it looks like this</p>
  
  <pre><code>var $rowCount=0;
  function invest() {
    $rowCount=$('#ulinvestment').find('.rowInvestment').length;
  }
  </code></pre>
  
  <p>my controller function contains</p>
  
  <pre><code>function input(parameter //i want to pass $rowcount value here ){
  $this-&gt;load-&gt;helper('form');
  $this-&gt;load-&gt;helper('html');
  $this-&gt;load-&gt;model('mod_user');
  $this-&gt;mod_user-&gt;insertdata();
   }
  </code></pre>
  
  <p>I want to access the variable <code>$rowCount</code> in controller function, how can I do that?</p>