This is most interesting topic 's jQuery, Here is two steps to check if is HTML element are clicked or not? Step 1: In this step, we used the .data() method to set the data (true). Example. $( this ).data( 'clicked' , true ); Step 2: In this step, we used the .data() method to get the data which are set. Ex ample. var data = $( '#activeLogomain' ).data( 'clicked' ); The detail code sample are give below. < script type ="text/javascript"> $( "#activeLogomain" ).click( function () { $( this ). data ( 'clicked' , true ); }); if ($( '#activeLogomain' ).data( 'clicked' )) { $( '.nav_menu li' ).each( function () { ...
Angular, React, JavaScript, Java, PHP, SQL, C#, Vue, NodeJs, TypeScript and Interview Questions Answers