
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 8591 Articles for Front End Technology

205 Views
To validate a specific URL, use regular expression.ExampleThe code is as follows −function validateSoundURL(myURL) { var regularExpression = /^https?:\/\/(tutorialspoint\.com)\/(.*)$/; return myURL.match(regularExpression) && myURL.match(regularExpression)[2] } console.log(validateSoundURL("https://tutorialspoint.com/index")); console.log(validateSoundURL("https://tutorialspoint.com/java"));To run the above program, you need to use the following command −node fileName.js.Here, my file name is demo259.js.OutputThis will produce the following output on console −PS C:\Users\Amit\javascript-code> node demo259.js index java

2K+ Views
Let’s say the following is our fixed element div − Fixed The CSS style to fix the above element −.fixedElement { position: fixed; background-color: skyblue; top: 0; left: 0; right: 0; }Following is our element, which will be scrolled − David Miller Now, use the window.scrollTo().ExampleLet us see the complete code − Live Demo Document .fixedElement { position: fixed; background-color: skyblue; top: 0; left: 0; right: ... Read More

13K+ Views
JavaScript Get href Value is a useful tool for web developers and designers who need to quickly access the value of an HTML element's href attribute. This article will provide step-by-step instructions on how to use JavaScript to get the value of an href attribute on a webpage, as well as some tips and tricks for getting the most out of this powerful feature. The ability to quickly obtain the values from an HTML element's attributes can help make development faster and more efficient, so let's get started! The value of the href attribute in JavaScript is a URL ... Read More

670 Views
Let’s say the following is our file and we need to read this file using jQuery.The name of the file details −ExampleFollowing is the code − Live Demo Document function chooseFile() { dataFromMyFile = document.getElementById("readFileDemo").files[0]; readDataFromFile = new FileReader(); readDataFromFile.onload = () => { data = readDataFromFile.result; console.log("Your File Data is="); console.log(data); }; readDataFromFile.readAsText(dataFromMyFile); } ... Read More

973 Views
This article will explain how to use the JavaScript string method 'replace()' to delete all text up to a character in a URL. We'll walk through an example of how this technique can be used for cutting off unnecessary information from a URL, and provide some helpful tips on when you might want to use this approach. A character pattern is what makes up a regular expression. The pattern is applied to text to perform "search-and-replace" operations that match patterns. A RegExp Object in JavaScript is a pattern with properties and methods. The replace() in JavaScript The replace() method ... Read More

1K+ Views
The ability to multiply only specific values in a JavaScript object can be a useful tool for performing calculations or making modifications to data. By using the map() and reduce() methods, you can quickly go through an entire object and make changes to any value that meets certain criteria. This article will provide an overview of how this process works as well as offer some examples of how it can be used in practice. An object in JavaScript is a separate entity having properties and a type. Example In the following example, we are running the script where ... Read More

1K+ Views
Adding a new CSS rule can help to create the desired look and feel for your web page or application. This article will explain how to insert a new CSS rule while working on JavaScript. It will provide step-by-step instructions on how to write and apply the necessary code in order to achieve the desired result. Additionally, we will also discuss some of the potential problems that may arise when inserting a new CSS rule into an existing project. The style sheet language known as CSS (cascading style sheets), is used to shape the HTML elements that will be ... Read More

3K+ Views
Regex (or Regular Expressions) is used to match patterns in strings of text. With JavaScript, you can use regex to dynamically replace data based on matched patterns. This article will explain how to use regex and JavaScript together to make dynamic replacements in your code. We'll cover the basics of regex syntax, regular expression objects, and methods for using them with JavaScript. JavaScript offers various data types to store various types of values. Because the JavaScript engine uses variables in a dynamic manner, it is not necessary to specify the type of a variable when using JavaScript. Here, the ... Read More

2K+ Views
Are you looking for ways to convert an integer to binary in JavaScript? If so, this article is for you! In this article, we will discuss the various methods available for converting an integer into its binary equivalent using JavaScript. We’ll look at how a number can be broken down into individual bits and manipulated accordingly. Converting an integer to binary is simply changing the integer value into a binary value. For example, assume we have passed two integer values, 22 and 45, respectively, as: var x = 22; var y = 45; Now, if we perform ... Read More

2K+ Views
In this article, we will be discussing how to set up pin validation using JavaScript. We will cover topics such as creating a prompt for users to enter their pin number, validating the user's input against a stored value, and returning an appropriate response based on the result of the comparison. Data validation is the procedure used to make sure that the user input is accurate, reliable, and tidy. The user has entered a valid date, text in a numeric field, and all needed fields have been filled out, according to typical validation procedures. We can validate pin ... Read More