12.07.2015 Views

Answers to practice questions for the final exam. 1. Write a CSS style ...

Answers to practice questions for the final exam. 1. Write a CSS style ...

Answers to practice questions for the final exam. 1. Write a CSS style ...

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

c).document.writeln(“This message will appear in <strong>the</strong> body.”)alert(“This message will appear in a pop-up window.”)It doesn’t make sense <strong>to</strong> use a function here. The differences between <strong>the</strong> two lines include notjust <strong>the</strong> values printed (“This message will appear in <strong>the</strong> body.” vs. “This messagewill appear in a pop-up window.”) but also <strong>the</strong> actions taken with those values(document.writeln() vs. alert()). The two lines don’t have enough in common <strong>to</strong> justifymaking <strong>the</strong>m a function.d).document.getElementById(“link1”).href = “error.html”document.getElementById(“link2”).href = “home.html”Ans: function changeLink(link,newhref) {// changes a link <strong>to</strong> point <strong>to</strong> <strong>the</strong> specified page.document.getElementById(link) = newhref}changeLink(“link1”,“error.html”)changeLink(“link2”,“home.html”)6. Give a complete HTML document that would create a set of frames as follows: <strong>the</strong> right halfof <strong>the</strong> browser window is a single frame named fright showing <strong>the</strong> file right.html. The lefthalf of <strong>the</strong> browser window is divided in<strong>to</strong> an upper portion 135 pixels tall, and two lowerportions taking up one third and two thirds of <strong>the</strong> remainder of <strong>the</strong> window, respectively. Thesethree frames should display <strong>the</strong> files logo.jpg, <strong>to</strong>c.html, and help.html, respectively, andshould be named flogo, f<strong>to</strong>c, and fhelp.Problem #67. <strong>Write</strong> a <strong>for</strong>m that will collect in<strong>for</strong>mation from a visi<strong>to</strong>r and sendit <strong>to</strong> be processed by JavaScript in <strong>the</strong> page summary.html. The <strong>for</strong>mshould collect <strong>the</strong> following in<strong>for</strong>mation: petName (<strong>the</strong> name of a pet),petType (which can be ei<strong>the</strong>r Dog, or Cat, or Bird) and pedigreed (whichis ei<strong>the</strong>r true or false, and should start out checked). Your <strong>for</strong>mshould include a Submit but<strong>to</strong>n, and should demonstrate proper use of<strong>the</strong> tag.Pet’s name:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!