title: jQuery toggle function is deprecated. What should I use instead?
body: <p>I have a jQuery <code>.toggle()</code> not working after the latest version of jQuery. How should I write to make it working with the new jQuery Versions. Please help in writing the new method.</p>
  <pre class="lang-js prettyprint-override"><code>jQuery('.ia_select_all').toggle( function(){
        var ia_attr_id = jQuery(this).attr( 'data-id' );
        jQuery('.' +ia_attr_id+ ' option').prop( 'selected',true );
  },function(){
        var ia_attr_id = jQuery( this ).attr( 'data-id' );
        jQuery('.' +ia_attr_id+ ' option' ).prop( 'selected',false);
  });
  </code></pre>