You already know that JavaScript treats a Web page like a series of objects inside other objects.  It also has objects of it's own.  Object-oriented programming things of code as objects not as lines of code but for any more detail on that you will need to do some research.

You have put strings of text into variables.  Both JavaScript and PHP originally worked that way but now people are trying to make them more object-oriented.  That means it is not always clear whether you are using objects or not.  However this bit is object-oriented programming and so looks a bit different in the way it is written (the syntax).