Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Dishebh Bhayana
Page 3 of 4
How to apply CSS style using jQuery?
We can use jQuery's .css() method to apply CSS styles to HTML elements dynamically. jQuery is a JavaScript library that simplifies DOM manipulation and allows us to add interactivity and modify CSS styles of elements programmatically. Syntax $(selector).css(property, value) OR $(selector).css({ property: value, property: value, ... }) The jQuery css() method accepts either a single property-value pair as separate arguments, or an object containing multiple CSS properties and their values. Note: To run these examples, you need to include the jQuery library in your HTML file using a CDN ...
Read MoreHow to apply CSS style to the different elements having the same class name in HTML?
HTML classes are global attributes that are used by HTML tags to specify a list of classes that are case-sensitive in nature. These classes are then used by CSS to apply styling to that particular tag that has the class, and by JavaScript to manipulate the HTML element's behavior, interactivity, or styles. Syntax /* Select all elements with same class */ .classname { property: value; } /* Select specific element type with class */ elementname.classname { property: value; } Method 1: Using the Class Selector (.) ...
Read MoreHow to display logged-in user information in PHP?
In this article, we will learn how to display logged-in user information using PHP sessions. When building web applications with authentication, displaying user information on various pages provides a personalized experience for users. We can implement user authentication and display logged-in user information using PHP sessions along with HTML forms. Let's explore this with practical examples. Basic User Authentication System This example demonstrates a complete login system with user authentication and information display − Filename: login.php Login Page Login ...
Read MoreHow to eliminate extra space before and after a form tag?
In this article, we will learn how to eliminate extra space before and after a form HTML element so as to ensure a clean and compact form layout. When designing web applications, it's essential to have control over the spacing and layout to create a visually pleasing and well-organized user interface. Sometimes, there is extra space available before and after a tag, which can affect the overall design and alignment of your form elements. Let’s understand how to remove the extra space with the help of some examples. Example 1 In this example, we will remove the extra space ...
Read MoreHow to dynamically get the content height of a div using AngularJS?
In this article, we will explore how to dynamically get the content height of a HTML element using AngularJS, using its getContentHeight() function. In web development, there are often situations where we need to dynamically determine the height of a element based on its content. We can easily implement it with the help of AnguarlJS, a popular javascript framework, and the various utility functions provided by it. Let’s understand how to implement the above with the help of some examples. Example 1 In this example, we will add an ng-init="getContentHeight()" to the element, which calls the getContentHeight() ...
Read MoreHow to Dynamically Add/Remove Table Rows using jQuery?
In this article, we will learn how to dynamically add or remove table rows using jQuery, a popular JavaScript library, with the help of the click event listeners. Tables are a commonly used element in web development, especially when dealing with tabular data or dynamic content. Adding or removing table rows dynamically can be a powerful feature that allows users to interact with the data in real time. Let’s understand how to implement this with the help of some examples. Example 1 In this example, we will have an HTML table element with some row data in it. ...
Read MoreHow to display the tag name of the clicked element using jQuery?
In this article, we will learn how to display the tag name of the clicked element using jQuery, and with the help of click event listeners. jQuery is a popular JavaScript library that makes it easy to manipulate HTML elements on a web page or listen to user actions like click events and do some operation based on that action.. Let’s understand how we can achieve the above with the help of some examples. Example 1 In this example, we will add a heading, some text, and a list of items to the HTML document. And to display the ...
Read MoreHow to Display Spinner on the Screen till the data from the API loads using Angular 8?
In this article, we will learn how to display a spinner on the screen till the data gets loaded from an API, using Angular 8 and the HTTPClient service to fetch data from a dummy todos API. Angular 8 is a robust framework for building web applications. It offers many features that make creating dynamic and interactive user interfaces easy. Let’s use the framework and understand how to show a spinner component conditionally using an example. Prerequisites Before proceeding with the steps below, please ensure you have angular CLI installed on your systems, as we would be relying ...
Read MoreHow to display a popup message when a logged-out user tries to vote?
In this article, we will learn how to display a popup message when a logged-out user tried to vote using jQuery and its various methods. In many web applications, it is important to restrict certain actions to logged-in users only, for example, voting on a poll or a form. To implement this functionality, we will use the jQuery library and some basic HTML and CSS. We will show a popup message that informs the user that they need to be logged in to perform the desired action. Let’s understand the above approach with the help of an example − ...
Read MoreHow to display child row information using jQuery DataTables plugin?
In this article, we will learn how to display child row information using jQuery DataTables plugin. We will also provide some HTML code examples to illustrate the usage of this feature. jQuery DataTables is a powerful plugin that provides an easy way to display tabular data on a web page. It has a lot of features such as pagination, sorting, searching, etc. It also provides us with the DataTables plugin, which gives us the ability to display child row information, and consequently shows additional data related to each row. Now, let’s understand the feature with the help of some examples. ...
Read More