MZ How to hide/show event by JavaScript ?

Hello !
Is there way hide/show event in JavaScript ?

thx
Moved to: Javascript/Plugin Support

Why would you want to do this? There are ways to hide/show events using event commands, switches, and pages. Why do you need to do it via javascript?
Hello !
Is there way hide/show event in JavaScript ?

thx
Just to change whether the event is visible?

That is like this:
*character*.setTransparent(true/false)

Examples:
JavaScript:
// Set the calling event to transparent
$gameMap.event(this._eventId).setTransparent(true)

// Set event #5 to visible
$gameMap.event(5).setTransparent(false)

// Set the player to transparent
$gamePlayer.setTransparent(true)
Moved to: Javascript/Plugin Support

Why would you want to do this? There are ways to hide/show events using event commands, switches, and pages. Why do you need to do it via javascript?
It's not usable to create 20 switches or 20 pager per each stuff in game..
Best way for me use variables.. but variables checked with condition >= .. very strange for me
simple equal variables will be the best, and JavaScript is unnecessary

Original thread: https://forums.rpgmakerweb.com/threads/how-to-hide-show-event-by-javascript.151720/