Category: Website Development

JavaScript Events

1 JavaScript Events In our browser, anything we do is with the HTML. This HTML part has some predefined events to handle user interactions. Following are some of the HTML events: Event Description onchange This event is triggered when an HTML element has been changed onclick This event is triggered when a user clicks an […]

Continue Reading

JavaScript Objects

5 JavaScript Objects A JavaScript object is a variable which stores multiple data in the form of key and value pairs separated by a colon. This key (or name) value pair together is called property of an object. Example: An object with Employee Data var person = {firstName: “Priyanka”, lastName: “Pandey”, age: 22, education:”MCA”}; Creating […]

Continue Reading

JavaScript Numeric Operation

0 JavaScript Numeric Operation We have already performed several arithmetic operations on numbers till now. Apart from this, JavaScript provides following operations on numbers: Operation Description Example toString() It returns numbers as strings. var x = 123; var y = x.toString(); Output: “123” toFixed() It rounds a number to a given number of digits and […]

Continue Reading

JavaScript String Operation

1 JavaScript String Operation A JavaScript String is zero or more characters written within quotes. We can perform following operations on string: Operation Description Example String Length We can get length of any string stored in a variable. Syntax: var.length Here, var can be any variable. var txt = “Gargi”; var sln = txt.length; Output: 5 Finding a […]

Continue Reading

Translate »