Aman Gupta has Published 87 Articles

How to check the given element has the specified class in JavaScript?

Aman Gupta

Aman Gupta

Updated on 07-Mar-2023 11:45:20

690 Views

Overview To perform a certain task first we need to access that particular element by its class or by id so before accessing the element we check whether that class is present in that particular element or not. The classList object contains the built-in method classList.contains() in JavScript. This method ... Read More

Check for the existence of key in an object using AngularJS

Aman Gupta

Aman Gupta

Updated on 07-Mar-2023 11:41:05

1K+ Views

Overview The existence of a key in an object can be checked using AngularJS. The key in an object is unique and cannot be duplicated. As object is a collection of different data types in Key-Value form, which contains String, Number type of data into a single reference variable. To ... Read More

How to check if CSS property is supported in browser using JavaScript?

Aman Gupta

Aman Gupta

Updated on 07-Mar-2023 11:26:43

1K+ Views

Overview In today's world there are various browsers available on the system. So sometimes there are certain Cascading Style Sheets (C.S.S.) property that does not run on that browser. So to check which CSS properties are supported for that specific browser, JavaScript has the in-built method CSS.supports(), which checks whether ... Read More

How to check an array is empty or not using jQuery?

Aman Gupta

Aman Gupta

Updated on 27-Feb-2023 16:16:34

5K+ Views

Overview In jQuery, we can easily check whether an array is empty or not by using multiple methods. The collective way includes length property and as in JavaScript arrays are the object so using the jQuery alias symbol $.isEmptyObject(objName). An array is a collection of elements. So to achieve our ... Read More

How to check an element exist or not in jQuery?

Aman Gupta

Aman Gupta

Updated on 27-Feb-2023 16:14:52

3K+ Views

Overview We can check for an HTML element such as , , etc that they exist in the HTML page or not using jQuery. To achieve the solution, we have the "length" property of jQuery, which checks the specific element in the HTML document and returns the length of the ... Read More

How to check an element with specific id exist using JavaScript?

Aman Gupta

Aman Gupta

Updated on 27-Feb-2023 16:04:18

3K+ Views

Overview To check for a specific id in a HTML element to attain a certain task can be achieved with help of JavaScript. So to achieve the solution to the problem, we should have knowledge about how to access the HTML Document Object Model (DOM). So the HTML element that ... Read More

How to check a URL contains a hash or not using JavaScript?

Aman Gupta

Aman Gupta

Updated on 27-Feb-2023 15:53:16

612 Views

Overview To check whether a Uniform Resource Locator (U.R.L.) contains a hash (#text) or not with JavaScript, as JavaScript contains some pre-build methods which makes a straightforward task to obtain a certain goal. This can be done by using the hash property in JavaScript, which can be accessed by initializing ... Read More

Previous 1 ... 5 6 7 8 9
Advertisements