Change modal content

Documentation updated on December 6th.

Create a new Modal

First, we'll have to create our Modal to work on it. You have to store Chico UI's components in a JavaScript variable in order to access the public methods and properties. In this case, we are storing our Modal in the myModal variable.

The Modal will have this configuration:

var myModal = $("#modal").modal("<p>This is a modal window with static content.</p>");

Is the content boring? Change it!

We'll change the content using, as setter, the content method:

myModal.content("New content for myModal, using the content() method.");	

 See more on Modal documentation.

New content!

Now, if we use the content method as getter:

myModal.content();

It returns:

"New content for myModal, using the content() method."

This is simple, therefore you can try and change the Modal's content on your projects.