Found 6710 Articles for Javascript

How to add linethrough to IText using FabricJS?

Rahul Gurung
Updated on 12-Sep-2022 11:38:57

174 Views

In this tutorial, we are going to learn about how to add linethrough to IText object using FabricJS. The IText class was introduced in FabricJS version 1.4, extends fabric.Text and is used to create IText instances. An IText instance gives us the freedom to select, cut, paste or add new text without additional configurations. There are also various supported key combinations and mouse/touch combinations which make text interactive which are not provided in Text. Textbox, however, which is based on IText allows us to resize the text rectangle and wraps lines automatically. This is not true for IText as height ... Read More

How to add line height to multiline text in IText using FabricJS?

Rahul Gurung
Updated on 12-Sep-2022 11:36:51

608 Views

In this tutorial, we are going to learn about how to add line height to multiline text in IText object using FabricJS. The IText class was introduced in FabricJS version 1.4, extends fabric.Text and is used to create IText instances. An IText instance gives us the freedom to select, cut, paste or add new text without additional configurations. There are also various supported key combinations and mouse/touch combinations which make text interactive which are not provided in Text. Textbox, however, which is based on IText allows us to resize the text rectangle and wraps lines automatically. This is not true ... Read More

Create a Calculator using HTML, CSS, and JavaScript

Vivek Verma
Updated on 12-Jul-2024 17:53:45

97K+ Views

To create a calculator using HTML, CSS, and Javascript, we need to have basic understanding of working of HTML, CSS and JavaScript. Calculator is a simple tool which performs basic arithmetic calculations like Addition, Subtraction, Multiplication and Division. In this article, we are going to discuss how to create a Calculator using HTML, CSS, and JavaScript. Usually, if we observe any real-time calculator we know that it has: A grid of numbers (0-9 and 00). Basic arithmetic operators (+, -, /, x, %). Some symbols for ... Read More

Why JavaScript is called Richer Interface?

Manisha Patil
Updated on 24-Aug-2022 08:39:31

599 Views

There are a number of benefits to knowing JavaScript, often known as rich interface − By merging dynamic HTML elements, including HTML and JavaScript, rich user interfaces can be developed. However, because there are no interactions on the server side, the scope of such an interface is restricted to client-side activity and has very minor functional impacts. The strength of AJAX lies in its capacity to deliver even richer interfaces by enhancing their dynamic user interfaces with strong functionality through smooth server-side invocation power. Instead of requiring a full screen refresh, AJAX enables individual user interface elements to share data ... Read More

What is Undefined X1 in JavaScript

Manisha Patil
Updated on 24-Aug-2022 07:12:53

362 Views

In order to look at the outcome of Undefined X 1 in JavaScript, we first need to understand exactly Undefined in JavaScript represents. JavaScript has a keyword called undefined that has something to do with memory. The global object has the attribute undefined. In other words, it is a variable with a global scope. The primitive value of undefined is its starting value. Undefined is the type of a variable which has not been given a value. If a variable is being evaluated but doesn't have an assigned value, a method or statement will also return undefined. If a value ... Read More

How to open a webcam using JavaScript?

Kalyan Mishra
Updated on 23-Aug-2022 12:02:44

20K+ Views

In this tutorial, we will learn about the procedure to open a webcam using JavaScript. So, this can be done using WebRTC. WebRTC is a short form of Web Real-Time Communication. Using this object, we can access and capture the Webcam and Microphone devices that are available there in the user device. How to Access Webcam? We can access the user device Webcam and microphone using an ECMAScript object navigator.mediaDevices.getUserMedia(constraints). So, the getUserMedia() function by default seek user permission to use your Webcam. This function returns a promise and once you click ok and give the permission then the promise ... Read More

How to check if the value is primitive or not in JavaScript?

Kalyan Mishra
Updated on 23-Aug-2022 11:25:01

3K+ Views

In this tutorial, we are going to know the methods to check if the given data type is primitive or not. Datatypes in JavaScript 1. Primitive 2. Non-primitive Primitive data types − String, number, undefined, boolean, null, symbols, bigint. Non-primitive data types − Object A primitive datatype/value is something that is not an object, and it is represented at the bottom level of the language implementation. All primitive values are immutable which means that you cannot change their type instead you may reassign v new value to the variable. To check if the value is primitive or not, we check ... Read More

How to create an element from a string in JavaScript?

Kalyan Mishra
Updated on 23-Aug-2022 11:20:05

2K+ Views

In this tutorial, we will get to know about various methods to create an element from strings in JavaScript. Creating elements from a string can be very useful in case we have to generate elements dynamically which makes the website interactive. An example will be like in a to-do list app we add, delete, and edit to-do items. The createElement() Method We create JavaScript items using the createElement() method. To create a particular element, we pass the item name as a string into the createElement() method. The createElement(tagName) function has a parameter as the name of the tag which will ... Read More

How to create notes taking app using HTML, Bootstrap and JavaScript?

Kalyan Mishra
Updated on 23-Aug-2022 11:17:36

620 Views

In this tutorial, we will make a notes-taking app using HTML, Bootstrap, and JavaScript. So, the HTML will use here to add different-different elements, bootstrap will be working here to beautify our design like CSS, and JavaScript will be adding basic functionality like adding and deleting our notes. Let’s see our HTML design of the UI. Our UI will contain a simple text area where we will enter our desired note, a button which will use to add our given note to the list of notes and in the list of notes there will be a delete button on each ... Read More

How to create a string by joining the elements of an array in JavaScript?

Kalyan Mishra
Updated on 23-Aug-2022 11:10:01

575 Views

In this tutorial, we will see how to create a string by joining the elements of an array in JavaScript. We will see two different approaches to doing this task. The first approach is using a simple addition operator (+) to add the elements of the array and separator. The second approach is to use the join() method. Approach 1: Using the Addition Operator (+) In this approach, we will pass two parameters to the function the array of which elements we have to Join, and the second parameter will be the separator that the user has to give, basically, ... Read More

Advertisements