How does work a "toggle" function?


I want to change “Yes” and “No” on the <div> by clicking on the <a>:

Thank you!


You can do it like this:

With no parameters, the .toggle() method simply toggles the visibility of elements.

There also used to be an event handler named .toggle(). This was deprecated in jQuery 1.8 and removed in jQuery 1.9

Thank you very much :slight_smile: