Tag Archives: jQuery

jQuery: Iterate Through an Element’s Classes

More often than not, your HTML elements will have more than one class assigned to them. Now while it is easy to check if an element belongs to a certain class with jQuery’s built in hasClass function, you’ll be pleased to know it is just as easy to iterate through all of an element’s classes with some basic loop work.
Continue reading

Posted in jQuery, Tutorials | Tagged , , , , | 2 Comments

jQuery UI: Remember Your Open Tab

The jQuery UI library is a brilliant collection of official jQuery UI widgets and effects, one of them being the extremely useful Tabs widget.

Tabs allows you to shorten a page by placing bits of a page’s content into their own little “tabs”, which can be access by clicking on the tab header. A brilliant space saving mechanism and one that has become quite commonplace in applications these days.

Sometimes it is nice to remember what tab you currently have open so that when you travel to some other part of a site and then return to your original page, you want it to remember which tab you had currently selected. Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , , | Leave a comment

jQuery: Change the Selected Index of a Dropdown List

To change the selected value, or selected index if you will, of a dropdown list using jQuery is not particularly difficult. Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , | 5 Comments

jQuery: Invert a Selection of Checked Checkboxes

If you have a group of checkboxes on a page, sometimes it is quite nice to give the user some quickfire controls that allows him to select all or select none at a click of a button. Similarly, it is pretty cool to give him the option of inverting his current selection, in other words checking all of those checkboxes currently unchecked, while unchecking all the currently ticked checkboxes. Continue reading

Posted in Technology & Code, Tutorials | Tagged , , , , | 1 Comment

jQuery: Count the Number of Checkboxes Checked on a Page

To return the number of checked or ticked checkboxes on a page using jQuery is in actual fact pretty simple. By making use of the special :checked selector and combining it with the standard length property. Continue reading

Posted in jQuery | Tagged , , , , | 4 Comments