Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Exercises

11.2 Create a web page that contains four buttons. Each button, when clicked, should cause an alert dialog to display a different time or date in relation to the current time. Create a Now button that alerts the current time and date and a Yesterday button that alerts the time and date 24 hours ago. The other two buttons should alert the time and date ten years ago and one week from today.

11.3 Write a script that tests as many of the Math library functions in Fig. 11.1 as you can. Exercise each of these functions by having your program display tables of return values for several argument values in an HTML5 textarea.

11.4 Math method floor may be used to round a number to a specific decimal place. For example, the statement

y = Math.floor( x * 10 + .5 ) / 10;


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint