The directions are above and here is the code I have so far. We are not allowed
ID: 3710879 • Letter: T
Question
The directions are above and here is the code I have so far. We are not allowed to use jquery
<html >
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Project 2</title>
<script type= "text/javascript" language="javascript" >
function changeText(which){
which.style.color="purple";
which.style.fontSize="18pt";
}
function changeTextBack(which){
which.style.color="black";
which.style.fontSize="12pt";
}
function see(item) {
item.style.visibility="visible";
}
function nosee(item) {
item.style.visibility="hidden";
}
</script>
<style type="text/css">
.auto-style1 {
font-size: small;
}
</style>
</head>
<body>
<div id="roll";;>
Amy Winehouse</div>
<p><span class="auto-style1">Amy Winehouse was an english singer and songwriter. Winehouse was known for her deep</span><br class="auto-style1"/>
<span class="auto-style1">vocals and her genre of rhythm, blues, and jazz. On July 23rd, 2011 Amy Winehouse
passed away from alcohol intoxication</span></p>
<hr/>
<div class="auto-style1">Meryl Streep(disappearing text)</div>
<div id="item"><p><span class="auto-style1">Born on June 22, 1949, in Summit, New Jersey, Meryl Streep is considered</span><br class="auto-style1"/>
<span class="auto-style1">one of the greatest actresses working today.</span></p></div>
<span class="auto-style1">Aubrey Drake Graham (Stage name:Drake)
</span>
<p><span class="auto-style1">The world's only black Jewish-Canadian rap star.Drake initially gained recognition as an actor on the teen drama</span><br class="auto-style1"/>
<span class="auto-style1">television series Degrassi: The Next Generation in the early 2000s</span></p>
</body>
</html>
2. (10 pts) Create a web page with a person's name and then a paragraph with a short biography of himher underneath. His name and biography should be 12pt black. When you move your mouse over his name, it becomes 18pt, purple. When you move your mouse off his name, it changes back to its original size and color. If you click on his name, his biography will disappear. If you click on it again, it will reappear. There should be three people's names and biographies. You should make one function that will display or hide the biography based upon the id of the div tag that is sent to it as a parameter. Do not use the "visible/hidden" property, as this will remove the text but leave a large space where it was.Explanation / Answer
Following is the altered code:
<html >
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Project 2</title>
<script type= "text/javascript" language="javascript" >
function changeText(which){
which.style.color="purple";
which.style.fontSize="18pt";
}
function changeTextBack(which){
which.style.color="black";
which.style.fontSize="12pt";
}
function myFunction(item) {
var x = document.getElementById(item);
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
<style type="text/css">
.auto-style1 {
font-size: small;
}
</style>
</head>
<body>
<div id="roll";;>
Amy Winehouse</div>
<div>
<p><span class="auto-style1">Amy Winehouse was an english singer and songwriter. Winehouse was known for her deep</span><br class="auto-style1"/>
<span class="auto-style1">vocals and her genre of rhythm, blues, and jazz. On July 23rd, 2011 Amy Winehouse
passed away from alcohol intoxication</span></p>
<hr/>
<div class="auto-style1">Meryl Streep(disappearing text)</div>
<div id="item"><p><span class="auto-style1">Born on June 22, 1949, in Summit, New Jersey, Meryl Streep is considered</span><br class="auto-style1"/>
<span class="auto-style1">one of the greatest actresses working today.</span></p></div>
<div class="auto-style1">Aubrey Drake Graham (Stage name:Drake)
</div>
<div id="item1">
<p><span class="auto-style1">The world's only black Jewish-Canadian rap star.Drake initially gained recognition as an actor on the teen drama</span><br class="auto-style1"/>
<span class="auto-style1">television series Degrassi: The Next Generation in the early 2000s</span></p>
</div>
</body>
</html>