The document.getElementBy Id function grabs an DOM element of a given id (here the exampleForm), i.e.e the entire form. When it is submitted the function is running.
If the password does not match, a new p tag element is created when it does not already exists. It is checked if it does not already exists with the document.getElementById method and checking for the id notify. It if does not exist the document.createElemente method is used and a p tag specified. This parameter is just the name of a type of element, e.g. "p", "form" or "canvas". The the text content of this p tag is set and the id attribute is set to notify so if it is submitted multiple times it does not create a new p tag every single time.
Finally a reference to the body tag is fetched as the body element has the id body. Notify is append to this body.