In this tutorial , we will show you how you can open a URL in a new Tab and not a new window. we will start by creating a function to load a given URL into a new Tab . We can do this directly in the onclick JavaScript Action without a function . When […]
Catégorie: JavaScript
(SOLVED) Button Onclick , Alert Input Text Value [HTML + JavaScript]
Onclick alert input text.. In this tutorial , we will try to create a code in HTML and JavaScript. One Html button , and a Html input text. When the user writes some text in the input and click on the button. A JavaScript alert will show the value of the input text . First […]
(SOLVED) how to insert an HTML element before another ?
If you need to insert an HTML element like one <div> or any other element before an existing element in the HTML Document you have to : 1. Get the element by ID : 2. Create the HTML element 3. Insert the element Here we will use insertBefore function to insert the created Div before the recovered Table. If you want […]
(SOLVED) (JavaScript / TypeScript) how to delete a HTML element By Id ?
If you need to delete an HTML element like one <div> or any other element existing in the HTML Document you have to : 1. Get the element by ID : 2. Delete this element : If you need to insert an HTML element like one <div> or any other element before an existing element , try this simple […]
JavaScript : Qu’est-ce que le DOM ?
Le DOM ( Document Object Model ) c’est-à-dire “modèle d’objet de document”, en français , c’est une interface de programmation qui est une représentation du HTML d’une page web et qui permet d’accéder aux éléments de cette page web et de les modifier avec le langage JavaScript. Le DOM est comme un arbre où chaque élément peut avoir zéro ou plusieurs enfant. […]

Get The Differences Between Two Dates In JavaScript
JavaScript Differences Between Two Dates : Hi, welcome to the practice house. In this tutorial, we will learn about how to get the difference between two dates in JavaScript. Almost all the time, we use date input field to select the date. Sometimes we need to find the difference between two dates. If you are […]

Type Script : sum of object properties within an array
If we need to sum a simple array, we can use the reduce method, that executes a reducer function (that you provide) on each member of the array resulting in a single output value. For example: But if we have an objects array like the following: We need to use the map method (that creates a new array […]
(SOLVED) getTime() is not a function ?
getTime() is not a function : if you are using the function getTime() and you have this error (in javascript / Typescript ) that mean you are using the date as a String , so as a solution you must parse the Date. See the next example to understand how solve this !Solution :
(SOLVED) TypeScript – Get difference between two dates in days
if you need to get the difference between two dates in days. you can use this function : if you are using the date as a String you can have this error getTime() is not a function ! so if you have this error try this solution