Tag Archive: JavaScript

How to Create a Simple calculator Using HTML and JavaScript

Here are the steps to create a simple calculator using HTML and JavaScript which can evaluate simple arithmetic on integer numbers. Two types of inputs text and button are used here on a table within a form element and OnClick event was used to insert button values on the screen or to evaluate the numbers. Steps to create a Simple calculator Using HTML and JavaScript 1. At first Insert a <form> element within <body> tag. 2. Create a table using…
Read more

20+ Multiple Choice Questions On JavaScript Functions

This set of multiple choice questions on JavaScript functions includes MCQ on JavaScript function definition, nested  function and different ways of invoking functions. It also includes about closures and its implementation, function properties, methods, constructor, callable objects, different ways of processing arrays with functions, higher order function and partial application of functions.  1. JavaScript functions can be invoked in which of the following ways. i) as functions   ii) as methods   iii) as constructors A) i and ii only…
Read more

Top 20 Multiple Choice Questions on JavaScript Arrays

Here you will get collections of multiple choice question on JavaScript Arrays includes MCQ on adding and deleting array elements. It also includes different ways of iterating arrays for both dense and sparse arrays along with testing elements in order to execute null, undefined and non existent elements. MCQ on different array iteration methods and ECMAScript 5 array methods in JavaScript also included here. 1. A …………………. array is one in which the elements not have contiguous indexes starting at…
Read more

Top 30 Multiple Choice Questions On JavaScript Object

This set of multiple choice question on JavaScript object includes MCQ on JavaScript property attributes, object attributes and categories of JavaScript objects. It also includes MCQ and interview questions on object literals, prototypes, inheritance along with deleting properties, testing properties and enumerating properties of JavaScript. 1. An object is an un-ordered collection of ………………………, each of which has a name and a value. A) properties B) names C) values D) All of the above 2. The ……………………… attribute of an…
Read more

Top 20 MCQ On JavaScript Expressions And Operators

This set of multiple choice question on JavaScript expression and operators includes MCQ on JavaScript equality, inequality and comparison operators. It also includes about logical, assignment and evaluation expressions along with different types of operators; conditional, typeof, delete, void and comma used in JavaScript. 1. The ……………. operator is known as the equality operator, which checks whether its two operators are “equal” using a more relaxed definition of sameness that allows type conversion. A) = B) = = C) =…
Read more

MCQ On JavaScript Types, Values And Variables Part-2

This set of multiple choice question on JavaScript types, value and variables includes MCQ on JavaScript type conversions, explicit conversion and object to primitive conversions used in JavaScript. It also includes about the difference between primitive values and mutable object reference and equality in JavaScript. 1. Any value other than ………………… has a tostring( ) method and the result of this method is usually the same as that returned by the string( ) function. i) number     ii) null    iii) boolean  …
Read more

MCQ On JavaScript Types, Values And Variables Part-1

This set of multiple choice question on JavaScript types, value and variables includes MCQ on number, text or strings, Boolean, null and undefined values along with global and wrapper objects used in JavaScript. It also includes about the difference between primitive values and mutable object reference, type conversions and equality in JavaScript. 1. The kind of values that can be represented and manipulated in a programming language are known as ………….. A) Types B) Variables C) Symbols D) Constants 2….
Read more

How To Handle Drag and Drop Event In JavaScript

Drag and drop is a user interface for transferring data between a “drag source” and “drop target” that may be in same application or in different applications. Any document element that has the HTML draggable attribute is a drag source and the the element where the HTML element dropped is drop target. In other words, drag and drop allows the user to click and hold the mouse button down over an element, drag it to another location, and release the…
Read more

How To Make All External Links Nofollow Using JavaScript

Creating a webpage with proper uses of internal and external links is the oldest and most used way of Search Engine Optimization(SEO). You can create the links in your webpage in two ways using “nofollow” tag, which tell the search engine and crawlers not to follow and crawl your hyperlinks and without using “nofollow” tag, which allows the search engine and crawlers to follow and crawl your hyperlinks. The rel=”nofollow” attribute helps to control the flow of page rank from…
Read more

How To Change The ClassName Using JavaScript

It is possible to redefine the CSS property of any HTML element with changing ClassName using JavaScript. A JavaScript function can assign, remove or replace the name of the class of any HTML element. Following are the different methods of changing the className. Changing The ClassName To Change The CSS Style Here is an example where the style of an element toggles between by setting the element’s className property alternatively to an existing style sheet class selector name and an…
Read more