toggleClass (understanding JS code)?

Hi, I am so sorry for spam. I am not a programmer, but I like to know what the following JS code does.

//Toggle mobile menu
$('.ves-megamenu-mobile #menu .opener').on('click', function(e) {e.preventDefault();
$("#menu-top .nav-item").removeClass("item-active");
var parent = $(this).parents(".nav-item").eq(0);
$(this).toggleClass('item-active');
$(parent).find(".submenu").eq(0).slideToggle();
return false;
});

As far as I understand, this JS does change something in CSS, so that hover on the menu is only valid on normal browsers. But click (instead of hover) is for mobile browsers.

Is this correct?

Does “mobile” also include iPad?

I am not into jquery much,

But toggling a class removes it if it exists and adds it if it doesn’t

Yes you are right the jQuery .toggleClass() works in this way only.

Does “mobile” also include iPad?
Yes

Thanks so much for your replies!