Premium Essay

Sd1340

In:

Submitted By renzomaguina
Words 637
Pages 3
Renzo Maguina SD1340 HTML5, CSS3 and JavaScript Lab 5-1
Questions:
Which <input> fields that you used were introduced in HTML5?
Following input types are introduced in HTML5:
1.Date
2.Tel
3.Email
4.Number
5.url
What is the difference between the two?
Internet 8 explorer opens the code with no errors and chrome comes up blank.
What change would you make to accept both positive and negative numbers as valid?
Add a loop to the characters to ensure that both positive and negative characters would be included in the function.
HTML CODE:
<!DOCTYPE HTML>
<html>
<head>
<title>Event Scheduler</title>
<script>
function ScheduledEvent(evtDate, evtTitle, maxattendees, coordinator, phonenum, email, infourl) { this.evtdate = evtDate; this.evttitle = evtTitle; this.maxattendees = maxattendees; this.coordinator = coordinator; this.phonenum = phonenum; this.email = email; this.infourl = infourl;

this.PrintEvent = PrintEvent;
}
function PrintEvent() { document.write("<p>You have scheduled an event named " + this.evttitle); document.write(" that will occur on " + this.evtdate); document.write(" and allow up to " + this.maxattendees + " attendees. "); document.write("The event is coordinated by " + this.coordinator); document.write(" who can be reached at " + this.phonenum); document.write(" or by email at " + this.email + ". "); document.write("More information about the event is available at <a href='" + this.infourl + "'> " + this.infourl + "</p>");
}
function IsNumeric(sNumber) { var numberChars = "0123456789."; var IsNumber = true; var currentChar; for (i = 0; i < sNumber.length && IsNumber == true; i++) { currentChar = sNumber.charAt(i); if (numberChars.indexOf(currentChar) == -1) { IsNumber = false; } } return IsNumber;
}

Similar Documents

Premium Essay

Week 5 Sd1340

...Description: Divide the class into groups of three or four students. Assign each group one of the following objects: Product MusicDownload User TakeoutItem ElectronicBook Video Ask each group to identify at least three properties and one method for each object and write the JavaScript code they would use to define the object. Have a member of each group write their code on the whiteboard. Built-In Objects EXPLORE ACTIVITY 4: BUILT-IN OBJECTS In-Class Activity Ungraded Course Support Tools/Resources required for this activity: Unit 5 PowerPoint Presentation (SD1340.U5.PP1) Unit5Sample2.html (SD1340.U5.AF2) Description: Use Slides 22 through 32 to discuss built-in objects. Students have already been introduced to the Array, String, and Math built-in objects. Use Slides 22 and 23 to show how a built-in object can be extended. Use Slides 24-26 to explore the Math object. Unit5Sample2.html (SD1340.U5.AF2) illustrates how random numbers are chosen, by generating a group of numbers and then calculating their average. An average of 0.5 indicates a random distribution. You can run the code more than once to show how the results differ. Slide 27 explains how you can use the “with” keyword to reduce the amount of typing. Use Slides 28-32 to discuss the Date object. Estimated Time: 20 minutes...

Words: 1297 - Pages: 6