Javascript If you specify a number outside the expected range, the date information in the Date object is updated accordingly. For example, if you specify 1010, the number of seconds is incremented by 1, and 10 is used for the milliseconds. Example Try the following example. JavaScript setMilliseconds Method var dt = new Date( "Aug 28, 2008 23:30:00" ); dt.setMilliseconds( 1010 ); document.write( dt ); Output Thu Aug 28 2008 23:30:01 GMT+0530 (India Standard Time) setMinutes () Javascript date setMinutes() method sets the minutes for a specified date according to local time. Syntax Its syntax is as follows: Date.setMinutes(minutesValue[, secondsValue[, msValue]]) Note: Parameters in the bracket are always optional. Parameter Detail minutesValue : An integer between 0 and 59, representing the minutes. 248
Javascript secondsValue : An integer between 0 and 59, representing the seconds. If you specify the secondsValue parameter, you must also specify the minutesValue. msValue : A number between 0 and 999, representing the milliseconds. If you specify the msValue parameter, you must also specify the minutesValue and secondsValue. If you do not specify the secondsValue and msValue parameters, the values returned from getSeconds and getMilliseconds methods are used. Try the following example. JavaScript setMinutes Method var dt = new Date( "Aug 28, 2008 23:30:00" ); dt.setMinutes( 45 ); document.write( dt ); Output Thu Aug 28 2008 23:45:00 GMT+0530 (India Standard Time) setMonth () Javascript date setMonth() method sets the month for a specified date according to local time. Syntax The following syntax for setMonth () Method. Date.setMonth(monthValue[, dayValue]) Note: Parameters in the bracket are always optional. Parameter Detail 249
About the Tutorial JavaScript is a
Bitwise Operators .................
23. String ........................
setUTCDate () .....................
Checking for Plug-Ins .............
1. OVERVIEW Javascript What is Java
Javascript components, integrates w
Javascript This function can be use
Javascript The following example sh
Javascript JavaScript in Chrome Her
4. PLACEMENT Javascript There is a
Javascript This code will
5. VARIABLES Javascript JavaScript
Javascript Within the body of a fun
6. OPERATORS Javascript What is an
Javascript the right operand, if ye
Javascript Output (a == b) => false
Javascript Output (a && b) => fal
Javascript document.write("(a | b)
Javascript Ex: C /= A is equivalent
Javascript Set the variables to dif
Javascript Function Undefined Null
7. IF-ELSE Javascript While writing
Javascript Output Qualifies for dri
Javascript Try the following code t
Javascript Syntax The objective of
Javascript switch (grade) { case 'A
Javascript Syntax The syntax of whi
Javascript do{ Statement(s) to be e
10. FOR LOOP Javascript The for Loo
Javascript Current Count : 6 Curren
Javascript Set the variable to diff
Javascript Set the variable to
Javascript Entering the loop 2 3 4
Javascript Output Entering th
13. FUNCTIONS Javascript A function
Javascript Click the following butt
Javascript Click the following but
Javascript Use different parameters
Javascript var variablename = funct
14. EVENTS Javascript What is an Ev
Javascript ....... onmouseove
Javascript ondragenter script Trigg
Javascript onplaying script Trigger
15. COOKIES Javascript What are Coo
Javascript Enter name: Outp
Javascript Setting Cookies Expiry D
Javascript Output Enter Cookie Na
Javascript Example Try the followin
Javascript setTimeout('Redirect()',
17. DIALOG BOX Javascript JavaScrip
Javascript Output Click the fol
18. VOID KEYWORD Javascript void is
Javascript Click the followin
Javascript 2. If you do not want to
Javascript 104
Javascript Methods are useful for e
Javascript Output Book title is
Javascript User-defined objects /
Javascript In the following section
Javascript Click the following t
Javascript Day of the Month must be
Javascript alert("Value of bigNumbe
Javascript constructor It returns a
Javascript Try the following exampl
Javascript document.write(""); docu
Javascript document.write("num.toPr
Javascript Returns the primitive va
Javascript Returns the function tha
Javascript Method toSource() toStri
Javascript Output flag.toString
23. STRING Javascript The String ob
Javascript Try the following exampl
Javascript concat() indexOf() lastI
Javascript document.writeln("str.ch
Javascript Argument Details string2
Javascript lastIndexOf () This meth
Javascript var index = str1.localeC
Javascript substring. $n or $nn Whe
Javascript Search () This method ex
Javascript document.write( sliced )
Javascript Try the following exampl
Javascript Return Value Returns a s
Javascript JavaScript String toLow
Javascript var str = "Apples are r
Javascript were in a tag sup() Cau
Javascript blink () This method cau
Javascript Try the following exampl
Javascript JavaScript String font
Javascript JavaScript String link(
Javascript JavaScript String strik
Javascript JavaScript String sup(
Javascript input length prototype T
Javascript Prototype The prototype
Javascript push() reduce() reduceRi
Javascript every () Javascript arra
Javascript } var passed = [12, 5, 8
Javascript Array.prototype.filter =
Javascript } }; Example Try the fol
Javascript var len = this.length; v
Javascript join () Javascript array
Javascript var from = Number(argume
Javascript min ( ) This method retu
Javascript var value = Math.pow(7,
Javascript Return Value Returns the
Javascript Output First Test Val
Javascript Example Try the followin
27. REGEXP Javascript A regular exp
Javascript Examples Following examp
Javascript m g Specifies that if th
Javascript Try the following exampl
Javascript Test1 - ignoreCase prope
Javascript if ( re.multiline ){ doc
Javascript exec ( ) The exec method
Javascript document.write("Test 2 -
Javascript document.write("Test 1 -
Javascript There are several DOMs i
Javascript forms[ ] 9 An array of F
Javascript Ex: document.close( ) op
Javascript This is main title Click
Javascript createElement( tagName)
Javascript NOTE: This example r
Javascript Specifies the loading st
Javascript NOTE: This example
Javascript Part 3: JavaScript Advan
Javascript Logical Errors Logic err
Javascript Now let us try to catch
Javascript Output Click the followi
Javascript Click the following to s
30. FORM VALIDATION Javascript Form
Javascript Basic Form Validation Fi
Javascript var emailID = document.m
Javascript Manual Animation So let'
Javascript } function moveRight(){
Javascript It is not possible to s
Javascript Output Checking for Plug
Javascript //--> If you
Javascript Error Messages in Firefo
Javascript Use a JavaScript Debugge
34. IMAGE MAP Javascript You can us
Javascript Output You can feel the
Javascript 6 plugins[] This propert
Javascript document.write(" Browser