jQuery toggling without using toggle

jQuery toggling without using toggle //set initial status $(‘element’).data(‘status’,’not_clicked’); $(‘element’).click(function(){ if( $(this).data(‘status’) == ‘clicked’ ) { $(this).data(‘status’,’not_clicked’); //your code in case of second click } else { $(this).data(‘status’,’clicked’); //your code in case of first click } }); jQuery toggling without using toggle What it does: Sets the initial status – not_clicked In case of a […]

Bitnami