- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 8862 Articles for Front End Technology
![Nikhilesh Aleti](https://www.tutorialspoint.com/assets/profiles/519798/profile/60_1221559-1663324574.jpg)
26K+ Views
An event is defined as a change in an object's state. There are a number of events in HTML that show when a user or browser performs a certain action. JavaScript responds to these events when JavaScript code is embedded in HTML and allows execution. The process of responding to events is known as event handling. As a result, JavaScript uses event handlers to handle HTML events. In this article, we are going to discuss how to remove event handlers in JavaScript. Here, we use the removeEventListener() method to remove an event handler from an element in JavaScript. Using the ... Read More
![Nikhilesh Aleti](https://www.tutorialspoint.com/assets/profiles/519798/profile/60_1221559-1663324574.jpg)
279 Views
Events in HTML are “things” that take place using HTML elements. JavaScript can “respond” to these events when used in HTML pages. Events are produced as a result of user interaction with the elements of the user interface. The actions that trigger an event include, for instance, pressing a button, moving the mouse, typing a character on the keyboard, choosing an item from a list, and scrolling the page. Examples of HTML events are mentioned below − An HTML web page has finished loading An HTML input field was changed An HTML button was clicked Adding an event ... Read More
![vineeth.mariserla](https://www.tutorialspoint.com/assets/profiles/113102/profile/60_54725-1565946419.jpg)
1K+ Views
Yes, it is possible to change the content of the HTML in javascript. Usually HTML content will be in HTML tags such as , , etc. In javascript, we have DOM methods that have an ability to access the HTML tags. Those methods, such as document.getElementById(), document.getElementByTagName(), etc., make use of tags to change the HTML content.Example-1In the following example, the content in the span tag is changed using a javascript DOM method document.getElementById(). Live Demo Is javaScript is java. Once the above code is executed, we will get the following on the screen If we click ... Read More
![Nikhilesh Aleti](https://www.tutorialspoint.com/assets/profiles/519798/profile/60_1221559-1663324574.jpg)
871 Views
In this article, we are going to discuss how to convert a string to a floating-point number in JavaScript. We can convert a string to a floating point in three ways − Using the parseFloat() method. Using the parseInt() method. Using type conversion. Using the parseFloat() method The parseFloat() is a function in JavaScript, this accept the string as input and convert the value into a floating point number. Let’s consider a scenario where there is numeral value in the string and also if the first character of the string is not a number then the resultant output ... Read More
![vineeth.mariserla](https://www.tutorialspoint.com/assets/profiles/113102/profile/60_54725-1565946419.jpg)
238 Views
_without() This method is in the underscore.js library of javascript. It takes two parameters and removes, what are the elements present in the second array, from the first array. It doesn't bother whether the values are true or false, it checks each value one by one and proceeds the task. Make sure that it is case sensitive.syntax_.without( array, values);ExampleIn the following example, it checks whether the values present in the second parameter are in the first parameter or not and tries to remove the available values. Live Demo document.write(_.without([5, 6, 4, 8, 9, 9, 0, 1], 0, ... Read More
![Nikhilesh Aleti](https://www.tutorialspoint.com/assets/profiles/519798/profile/60_1221559-1663324574.jpg)
108 Views
In this article, we are going to discuss whether provided elements in an array have passed a specified condition or not in JavaScript. Here, we can use the _.filter() method, every() method, some() method, filter() method, and for loop. They return true if every element in an array has met the condition, otherwise, they return false. Using the Array.filter() method This Array.filter() method is a JavaScript function. Array.filter() method will be creating a new array containing the elements that are passed in the condition which is defined by function in program. This Array.filter() method will not execute if elements are ... Read More
![vineeth.mariserla](https://www.tutorialspoint.com/assets/profiles/113102/profile/60_54725-1565946419.jpg)
1K+ Views
_isEqual() _isEqual() is from the underscore and lodash library of javascript. It is used to compare javascript objects. The importance of this method is that it doesn't care about the order of properties while comparing the objects. It only checks whether the properties in the two objects are equal or not. Whereas JSON.stringify(), which is used in comparing the objects, checks even the order of properties of the objects, making _isEqual() the better option. syntax_.isEqual(object1, object2);It accepts two objects as parameters and scrutinizes whether they are equal or not.ExampleLive Demo var obj1 = {name: "Sikha", designation: "Content developer"}; ... Read More
![Nikhilesh Aleti](https://www.tutorialspoint.com/assets/profiles/519798/profile/60_1221559-1663324574.jpg)
24K+ Views
Objects in JavaScript is an entity, where it consists of properties and type. Let’s consider sports as an object, in Car the properties can be color, price, height, width, etc. Exactly the same also happens in JavaScript, which has objects and contains properties to them. Const car = { color : 'Black', price : 2500000, height : '6 feet', width : '5 feet' } The equality operator (===) verifies whether the two operands are equal or not and returns a Boolean value. If the both operands are ... Read More
![Nikhilesh Aleti](https://www.tutorialspoint.com/assets/profiles/519798/profile/60_1221559-1663324574.jpg)
2K+ Views
In this article, we are going to discuss how to use the spread operator to clone an array in JavaScript. Cloning is just the process of copying one array into another array. Previously, the slice() method was used to clone an array, however, ES6 now provides the spread operator(...) to simply clone an array. Before proceeding further let us look at the definitions of array and spread operator. Array An Array is usually a data structure, in JavaScript it is an object which can hold multiple values at once. For example, Below “Arr” is an array. Const Arr = [‘Tutorials’, ... Read More
![vineeth.mariserla](https://www.tutorialspoint.com/assets/profiles/113102/profile/60_54725-1565946419.jpg)
230 Views
We can define a property of an object using Dot and Bracket notations. There is also another way in which a property called Object.defineProperty() is used to define a property. It usually takes 3 parameters they are object name, property name, property descriptor.syntaxObject.defineProperty(object name, property name, property descriptor)Lets' define a property with this method.ExampleIn the following example, initially, the object has only one property named 'one'. Later on, another property named 'two' is added. Now when we tried to display all the properties, only the first property was displayed but not the added property as shown in the output.Live Demo ... Read More