Found 609 Articles for Front End Scripts

How to Find the Text on Page in ElectronJS?

Aman Gupta
Updated on 13-Oct-2023 15:38:34

188 Views

Overview A find text on a page is a feature which helps a user to find a word on the page. An electronJs is an open source framework which creates a desktop application which can run on every operating system with its cross platform compatibility. The electronJs has many predefined instance methods with their respective functionality. So to build this feature of find text on page the electronJs provides a "findInPage" method which takes the current focused window and scans all the text on the page. Syntax For finding the text on page, the electronJs provides the below Syntax for ... Read More

JavaScript Program to Find Minimum Insertions to Form a Palindrome

Prabhdeep Singh
Updated on 12-Jul-2023 10:51:42

99 Views

We are given a string and we have to find the minimum number of different character that we need to insert in the given string at any place so that the final string will be palindrome. A palindrome is a string that is just equal to the reverse of it. This problem is of dynamic programming, so we will first go for the recursive approach, then we will memorize it, and at the end we will see the tabulation of the memorization approach. Recursive ApproachExample const max = 1e5; // defining the upper limit // function to ... Read More

Typing and Deleting Effect with JavaScript and CSS

AmitDiwan
Updated on 02-Jan-2024 17:52:35

895 Views

With the help of CSS animations, we can create a typewriter typing and deleting effect using JavaScript. The infinite effect is also set. The custom function will get called and the words will get display with the effect. At the end, those words will get deleted using another custom function. Set a div for the text and cursor First, a parent div container is set with the element. One of the will have text and another the cursorL | Style the element A professional font is ... Read More

ES6 Default Parameters in nested objects – JavaScript

AmitDiwan
Updated on 09-Nov-2020 09:06:58

428 Views

Yes, you can pass default parameters in nested objects.Following is the code −ExampleFollowing is the code −function callBackFunctionDemo({ cl: { callFunctionName = "callBackFunction", values = 100 } = {} } = {}) {    console.log(callFunctionName);    console.log(values); } //This will print the default value. // 100 callBackFunctionDemo(); //This will print the given value. //500 callBackFunctionDemo({ cl: { values: 500 } });To run the above program, you need to use the following command −node fileName.js.Here, my file name is demo296.js.OutputThis will produce the following output on console −PS C:\Users\Amit\javascript-code> node demo296.js callBackFunction 100 callBackFunction 500

Sorting a JSON object in JavaScript

AmitDiwan
Updated on 21-Oct-2020 11:53:46

3K+ Views

Suppose we have an object like this −const obj = {    key1: 56,    key2: 67,    key3: 23,    key4: 11,    key5: 88 };We are required to write a JavaScript function that takes in this object and returns a sorted array like this −const arr = [11, 23, 56, 67, 88];Here, we sorted the object values and placed them in an array.Therefore, let’s write the code for this function −ExampleThe code for this will be −const obj = {    key1: 56,    key2: 67,    key3: 23,    key4: 11,    key5: 88 }; const sortObject ... Read More

Difference between ASP and ASP.NET

Nitin Sharma
Updated on 09-Jun-2020 08:29:55

4K+ Views

Both ASP and ASP.NET are the widely used languages for application and mainly the frontEnd development. Both the languages used for dynamic generation of web pages. The content generated through server-side scripting is then sent to the client’s web browser.Following are the important differences between ASP and ASP.NET.Sr. No.KeyASPASP.NET1DefinitionASP or also popularly known as Classic ASP developed by Microsoft is first Server-side scripting engine which is used for dynamic generation of web pages.ASP.NET, on the other hand, is a server-side web framework, open-source, which is designed for the generation of dynamic web pages.2Language typeASP is interpreted language that means the ... Read More

How to check whether a checkbox is checked with JavaScript?

AmitDiwan
Updated on 06-May-2020 13:30:44

685 Views

To check whether a checkbox is checked with JavaScript, the code is as follows −Example Live Demo Displaying textBox when a checkbox is checked Checkbox: Checkbox is checked!!!    document.querySelector(".check").addEventListener("click", checkFunction);    function checkFunction() {       var checkBox = document.querySelector(".check");       var textBox = document.querySelector(".textBox");       if (checkBox.checked == true) {          textBox.style.display = "block";       } else {          textBox.style.display = "none";       }    } OutputThis will produce the following output −On clicking the checkbox −

How to create a modal image gallery with CSS and JavaScript?

AmitDiwan
Updated on 06-Apr-2020 12:10:49

3K+ Views

Following is the code to create modal image gallery with CSS and JavaScript −Example Live Demo

HTML DOM hasFocus() method.

AmitDiwan
Updated on 19-Feb-2021 09:22:45

70 Views

The HTML DOM hasFocus() method is used for knowing if the document or any element inside the document has focus. It does so by returning a boolean value in which true represents the document/element has focus and false represents otherwise.SyntaxFollowing is the syntax for hasFocus() method −document.hasFocus()ExampleLet us look at an example for the hasFocus() method −Live Demo hasFocus() method Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. CHECK ... Read More

Map.entries() function in JavaScript

Samual Sam
Updated on 25-Jun-2020 12:13:29

42 Views

The entries() function of Map object returns an iterator of the corresponding Map object and using this you can retrieve the key Value pairs of the map.SyntaxIts Syntax is as followsmapVar.entries()Example Live Demo    JavaScript Example           var mapVar = new Map();       mapVar.set('1', 'Java');       mapVar.set('2', 'JavaFX');       mapVar.set('3', 'HBase');       mapVar.set('4', 'Neo4j');       var it = mapVar.entries();       for(i=0; i

1 2 3 4 5 ... 61 Next
Advertisements