Skip to content

How to display a message

cl4cnam edited this page Dec 5, 2023 · 4 revisions

General case

Just code:

displayNewMessage('yourMessage')

If you want to incorporate your message into another html element

code:

displayNewMessageIn('yourMessage', theEnclosingElement)

theEnclosingElement can be a HTMLElement or a CSS selector string.

The new displayed message is a <p> HTMLElement with a CSS class .display so you can style it in your stylesheet.

Note

If you've included lib.css, it gets a default style like this:

helloWorld

If you want to create a HTMLElement (other than <p>)

code:

displayNewElementIn('yourMessage', theEnclosingElement, typeOfNewElement, doesItScrollIntoView)

typeOfNewElement has to be a string with the tag name. doesItScrollIntoView has to be a boolean (true or false).