Dimah-Aldossari / W02D03-Lab-JS-OOP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

W02D03-Lab-JS-OOP

Car Object

  • Create a file called cars.html. You are going to create a webpage for a car salesman. The page will display details about cars that are for sale. Create whatever HTML you seem appropriate for this task and style the page as you like. However, be sure that the information about the cars for sale are displayed on the webpage.
  • Create a file cars.js.
  • Within cars.js:
    • Create at least 3 car objects.
    • Each car object should have the following properties: company, model, colour, image, registration number, price.
    • Each car object should also include a showMore() method.
    • Whenever a user clicks on an image of a car, the showMore() method should be called and all the information about the specific car object, including the registration number, price etc should be displayed.
    • Create a function that will be used to display the cheapest car object when cars.html is loaded, as alert.

Person Object

Create a file called persons.html. You are going to create a webpage for people to know each other. The page will display details about persons. Create whatever HTML you deem appropriate for this task and style the page as you like. However, be sure that the information about the persons are displayed on the webpage.

  • Create a file persons.js. Within persons.js:
    • Create at least 3 person objects.
    • The person object below is made up of a number of PROPERTIES that describe the person (name, age, gender, interests(as array) and img) and of METHOD: bio.
    • When a user click on image the bio function will be used to display the name, age, first two interests in appropriate message as alert.

About