title: multiselect checkbox dropdown call an Event when checked and Unchecked
body: <p>this is my html content when i checked a multiple dropdown checkbox i want to call a java script function but its not working.    i am using multiselect jquery <a href="http://www.codexworld.com/multi-select-dropdown-list-with-checkbox-jquery/" rel="nofollow">multiselect jquery</a></p>
  
  <pre><code>&lt;select name="langOpt2[]" multiple id="langOpt2"&gt;
      &lt;?php foreach($property_type as $row)  {  ?&gt;
         &lt;option value="&lt;?php echo $row['type']; ?&gt;" onchange="selectsearch(this.checked,'property_type',this.value);"&gt;&lt;?php echo $row['type']; ?&gt; &lt;/label&gt;
         &lt;/option&gt;
      &lt;?php } ?&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>my javascript code is - </p>
  
  <pre><code>&lt;script language="javascript"&gt;
  function selectsearch(val2,val1,state_id)
    {
  
    var title=state_id;
    alert('action');
    $.ajax({
    url: '&lt;?php echo base_url(); ?&gt;index.php/property/propertysearch',
    data: {'title':title,'name':val1,'status':val2 }, // change this to send js object
    type: "post",
    success: function(data){
    //document.write(data); just do not use document.write
    console.log(data);
    document.getElementById('search').innerHTML = data; 
    document.getElementById('search').style.display  = 'block'; 
    document.getElementById("search1").style.display = 'none';
    },
  
    error: function()
    {
    alert("Fail")
    }
  
    });
  
    }
   &lt;/script&gt;
  </code></pre>