Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

HTML PLEASE Create an object to represent a pet. Create properties for name, bre

ID: 3727632 • Letter: H

Question

HTML PLEASE
Create an object to represent a pet. Create properties for name, breed, and age. Create two different pet objects. Have the user enter the properties from the keyboard (use readline() to do this or the equivalent in Node - you may need to look it up). Display the properties back using print() or console.log()
HTML PLEASE
Create an object to represent a pet. Create properties for name, breed, and age. Create two different pet objects. Have the user enter the properties from the keyboard (use readline() to do this or the equivalent in Node - you may need to look it up). Display the properties back using print() or console.log()

Create an object to represent a pet. Create properties for name, breed, and age. Create two different pet objects. Have the user enter the properties from the keyboard (use readline() to do this or the equivalent in Node - you may need to look it up). Display the properties back using print() or console.log()

Explanation / Answer

//petCreation.js(Use proper api and enviornment)

Pet = Backbone.Model.extend({

initialize : function(data){

}

});

$(document).ready(function(){

var n,b,a;

n=prompt("Please enter name for pet1:");

b=prompt("Please enter breed for pet1:");

a=prompt("Please enter age for pet1:");

var pet1 = new Pet({name:n , breed:b, age:a});

console.log("Pet1-> Name:"+pet1.get("name")+" Breed:"+pet1.get("breed")+" Age:"+pet1.get("age"));

n=prompt("Please enter name for pet2:");

b=prompt("Please enter breed for pet2:");

a=prompt("Please enter age for pet2:");

var pet2 = new Pet({name:n , breed:b, age:a});

console.log("Pet2-> Name:"+pet2.get("name")+" Breed:"+pet2.get("breed")+" Age:"+pet2.get("age"));

});

//index.html

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Chegg</title>
<script src="liberaryFile/jquery-3.3.1.slim.min.js"></script>
<script src="liberaryFile/underscore-min.js"></script>
<script src="liberaryFile/backbone-min.js"></script>
<script src="customJavascript/petCreation.js"></script>

</head>
<body>

</body>
</html>