JSFiddle - React, Tailwind, and code Playground
by Ada Gonzalez
HTML
<body>
<h2>JSON Quiz 3</h2>
<p>Birman eyes: <span id="beyes"></span>
<br />Birman head Shape: <span id="bhead"></span>
<br />
</p>
</body>
JavaScript
var myFavoriteCatBreed = {
name: "Birman",
origin: "Myanmar",
characteristics: {
head: ["strong", "broad", "rounded"],
ears: "medium length",
eyes: "vivid blue",
body: "long stocky",
legs: ["medium-length", {
"paws": "large rounded"
}],
coat: ["silky", {
"length": "medium-long"
}]
},
temperament: ["placid", "playful", "people-oriented", "friendly", "intelligent", "curious"],
grooming: "weekly",
size: {
male: {
minWeightInLb: 9,
maxWeightInLb: 15
},
female: {
minWeightInLb: 6,
maxWeightInLb: 10
}
},
coatColors: {
variations: ["seal point", "blue point", "chocolate point", "lilac point", "red point", "cream point", "tortie point", "tabby point", "silver tabby point", "smoke point"]
},
lifeExpectancy: 15
};
document.getElementById("beyes").innerHTML = myFavoriteCatBreed.characteristics.eyes;
document.getElementById("bhead").innerHTML = myFavoriteCatBreed.characteristics.head[2];
for (var i = 0; i < myFavoriteCatBreed.temperament.length; i++) {
{
alert(myFavoriteCatBreed.temperament[i]);
}
}
function ShowMyFavoriteCatsTemperament()
{
for (var i = 0; i < myFavoriteCatBreed.temperament.length; i++) {
{
alert(myFavoriteCatBreed.temperament[i]);
}
}
}