In CSS, there are a few different ways that you can center HTML elements. If you’re working with block-level elements, you can use the margin: 0 auto trick, which uses margins to place any block-level element in the exact center of their parent element. That trick looks like this: div{ margin: 0 auto; } If …
jQuery
Using jQuery to Create a Click Counter
Here’s a cool jQuery snippet that you can use to create a click counter. The way it works is that each time an element is clicked, the counter (which starts at 0) goes up by one. The counter can be applied to the clicking of any particular elements or multiple elements, and you can choose whether …
JQuery Multiple Attribute Selector Example
This tutorial explains how to multiple elements in jQuery. The multiple attribute selector selects multiple elements within a form. It matches all the specified attributes in the document and it specifies the multiple elements can be selected at once. The multiple attribute selectors can be used to refer to several attributes of an element or …
JQuery Input Selector Example
This tutorial explains usage of input selector in jQuery. The input selector selects all the input elements in the document. It selects only form elements that can be represented as text box, password box, radio button, check box, submit button and reset button elements. The input element is used to create interactive controls for web …
JQuery Attribute Selector(Contains, Word, Starts With, Ends With)
JQuery Attribute Selector It selects all the elements that have attribute name or attribute value. It selects all the elements with specified attribute. It selects an element using the presence of an attribute or an attribute value. Attribute selectors are delimited by square brackets. They contain an attribute name surrounded by square brackets. JQuery Attribute …
JQuery remove(), removeAttr() and removeClass() Example
JQuery Remove() Method The remove() method is same as detach() method which removes the selected elements including all text and child nodes from the DOM. But it won’t keep all data and events associated with removed elements in the set of matched elements from the DOM completely. It restores elements data, not its event handlers. …
JQuery Wildcard (*) Selector Example
This tutorial highlights the benefits of JQuery wildcard selector (*) with simple examples. Wildcard selector used for selecting all the elements in the page. It is wildcard method and will selects all the elements in the document. It is also called universal selector, because it selects all the elements which are available in the document. …
JQuery Attr() Method Example
Jquery attr() method is used to retrieve the value of an attribute of the selected elements. It gets attribute for the element in the matched set. It sets attributes and values of selected elements and also sets one or more attributes for every matched element. It is also used to get attributes from the HTML …