Found 9053 Articles for Front End Technology

Find the non-digit character with JavaScript Regular Expression

Sravani Alamanda
Updated on 08-Dec-2022 10:26:56

1K+ Views

In this tutorial, we will learn to find the non-digit character with JavaScript regular expression. ASCII code 'A' is 65 and 'a' is 97 etc. Now, we will check how to find a nondigit element (\D) in a given text using RegExp. RegExp is an object that specifies the pattern used to do search and replace operations on string or for input validation. RegExp was introduced in ES1 and it is fully supported by all browsers. Syntax Syntax for the non-digit element is, new RegExp("\D") or simply /\D/ /\D/, is introduced in ES1. It is fully supported by ... Read More

Find non-word character in a string with JavaScript RegExp

Sravani Alamanda
Updated on 08-Dec-2022 10:06:31

1K+ Views

In this tutorial, we learn how to find non-word characters in a string using JavaScript Regular Expression. Actually, word characters include A-Z, a-z, 0-9 and _. Coming to the non-word characters except word characters like !, @, #, $, %, ^, &, *, (, ), {, } etc. Non-word characters, we denote as \W. We all know about RegExp (Regular Expression) in JavaScript. RegExp is an object that specifies the pattern used to do a search and replace operations on a string or for input validation. RegExp was introduced in ES1 and it is fully supported by all browsers. ASCII ... Read More

Find digits not between the brackets using JavaScript Regular Expressions?

Sravani Alamanda
Updated on 08-Dec-2022 09:22:47

73 Views

In JavaScript, the regular expression [^0-9] is used to find the characters inside the bracket but not a digit. Except digit mentioned in the bracket, it will return the remaining characters from the text as an array. We all know about RegExp (Regular Expression) in JavaScript. RegExp is an object that specifies the pattern used to do a search and replace operations on the string or for input validation. RegExp was introduced in ES1 and it is fully supported by all browsers. Syntax Syntax for non-digit or /[^0-9]/ character is- new RegExp("[^0-9]") or simply /[^0-9]/ Here /[^0-9]/ , ... Read More

How to find character between brackets in JavaScript RegExp?

Abhishek
Updated on 31-Oct-2022 07:32:04

1K+ Views

In this tutorial, we will learn how we can find a character between the brackets in JavaScript RegExp with examples. Syntax Following is the syntax that you have to follow for finding the character between the brackets of JavaScript RegExp − [……] In the above syntax, you can put the character or the combination of characters that you are searching in place of dots while the square brackets are the basic syntax to indicate the use of JavaScript RegExp. Below is the list of different syntaxes that you can use to check for the presence of different characters in ... Read More

How to find a character, not between the brackets in JavaScript RegExp?

Abhishek
Updated on 31-Oct-2022 07:30:26

946 Views

RegExp or RegEx in JavaScript is the short form of Regular Expressions. Regular Expressions are used to check validity of a particular combination of characters, digits, or any other symbol entered by the user. Regular expressions are mainly used for checking valid emails, and passwords that authenticate the correct user to log in. In this tutorial, we will learn how we can find a character that is not present between the brackets of JavaScript RegExp. Syntax Following is the syntax that is used to find the character, not between the brackets of JavaScript RegExp − [^……] In above syntax, ... Read More

Find word character in a string with JavaScript RegExp?

Sravani Alamanda
Updated on 08-Dec-2022 09:28:45

851 Views

In this tutorial, we will see how to find a word character from the text. Word character denote as \w. Word character is a character like a-z, A-Z and 0-9 and also includes underscore(_). We all know about RegExp (Regular Expression) in js. RegExp is an object and specifies the pattern used to do search and replace operations on string or for input validation. RegExp was introduced in ES1 and it is fully supported by all the browsers. ASCII code for A-Z is 65- 90, a-z is 97-122, 0-9 is 48-57 and for underscore is 95. Syntax Syntax for word ... Read More

What are the different types of DOM available to access and modify content in JavaScript?

Shubham Vora
Updated on 15-Nov-2022 10:54:22

844 Views

In this tutorial, we will learn what are the different types of DOM available to access and modify content in JavaScript. The Document Object Model (DOM) is a data representation of the objects that form the structure and content of a web document. It is an interface for scripting web pages. Programs can alter the document’s structure, style, and content by utilizing the DOM. The DOM represents each element as a node, and the programming languages like JavaScript can easily interact with the nodes to modify the page. There are different types of DOM available to access and modify content ... Read More

What are the three types of errors I can expect in my JavaScript script?

Shubham Vora
Updated on 31-Oct-2022 11:21:36

311 Views

In this tutorial, let us discuss the three types of errors we can expect in our JavaScript code. Errors are statements that block the execution of the program. During the compilation of the program, three types of errors can occur. These are syntax errors, run time errors, and logical errors. Syntax Errors Syntax errors are usual errors. Incorrect syntax causes parsing issues during the code interpretation. For example, add a semicolon instead of a colon in an object declaration. Syntax errors affect only the respective code thread. The remaining code works as it is. A grammatical mistake is the ultimate ... Read More

How to play a multimedia file using JavaScript?

Shubham Vora
Updated on 15-Sep-2022 12:02:02

988 Views

In this tutorial, we will learn how to play a multimedia file using JavaScript. The multimedia file is the audio and video files. The multimedia files can be of different formats. wav and mp3 are two examples of audio file formats, whereas mp4 and mkv are examples of video file formats. In HTML, multimedia files can be shown easily using different tags. We use the video tag for showing a video, and for audio, we use the audio tag. These two tags are quite similar, and many attributes are the same in both tags. The "src" attribute defines the path ... Read More

What is a Document Object Model?

Priya Pallavi
Updated on 18-May-2020 08:47:22

459 Views

A Document object represents the HTML document that is displayed in that window. The Document object has various properties that refer to other objects, which allow access to and modification of document content.The way a document content is accessed and modified is called the Document Object Model, or DOM. The Objects are organized in a hierarchy. This hierarchical structure applies to the organization of objects in a Web document.Window object − Top of the hierarchy. It is the utmost element of the object hierarchy.Document object − Each HTML document that gets loaded into a window becomes a document object. The document ... Read More

Advertisements