Java- A programming language used to write applications for computers and other devices.
- String- represents sequence of characters
- Number- represents numeric values
- boolean- represents boolean values
- Undefine- represents undefined values
- Null- represent no values
- Object- represents instance through which we can access members
- Array- represents group of similar values
- RegExp- represents regular expression
A repetition structure allows the programmer to specify that a script is to repeat an action while some condition remains true.
The do..while repetition statement is similar to the while statement. In the while statement, the loop continuation test occurs at the beginning of the loop, before the body of the loop executes. The do..while statement tests the loop continuation condition after the loop body executes: therefore, the loop body always executes at least once.
Switch multiple selection statement
Browser Objects Model
The Browser Object Model (BOM) is used to interact with the browser.
alert() → displays the alert box containing message with ok button.
confirm() → displays the confirm dialog box containing message with ok and cancel button.
prompt() → displays a dialog box to get input from the user.
open() → opens the new window.
close() → closes the current window.
setTimeout() → performs action after specified time like calling function, evaluating expressions etc.
Document Object Model
write(“string”) → writes the given string on the doucment.
writeln(“string”) → writes the given string on the doucment with newline character at the end.
getElementById() → returns the element having the given id value.
getElementsByName() → returns all the elements having the given name value.
getElementsByTagName() → returns all the elements having the given tag name.
getElementsByClassName() → returns all the elements having the given class name.
The change in the state of an object is call as an Event. we can use it to handle and verify user input.
We can also use keyboard events, form events, document events.
Now let’s see how to do a little project using this. We can create a TO DO LIST like as follow,
Try it your own way..