php - WordPress JavaScript

I'm trying to achieve a custom option inside the "Publish Metabox" in WordPress admin custom post. And I want to know is there any native way to do expand/collapse divs (Check the below screenshot).

I wonder how WordPress itself achieves it like the below screenshot? (Maybe match the IDs like bootstrap JS libraries do ?).

Screenshot

Answer

Solution:

And I want to know is there any native way to do expand/collapse divs.

There is. Wordpress uses the jQuery library on the admin side for interactive elements. In this case, it's just using a simple toggle effect.

Display or hide the matched elements.