JSFiddle - React, Tailwind, and code Playground

by lollero

JavaScript

$(document).ready(function(){
    
    var arr = [ 'test1' ];
     
    $('html').on("mouseenter mouseleave", function() {
    
        if ( jQuery.inArray( "test1", arr ) >= 0  ) {
            console.log('test1 exists.');
        }
                
        if ( jQuery.inArray( "test2", arr ) >= 0  ) {
            console.log('test2 exists.');
        }
            
    });
    

            
});