jQuery fans blog and community sharing news, plugins, video tutorials, demos and more.

jQuery Filter Objects by Data Attribute Value

How you might use jQuery to filter elements by their data Attribute values. This code snippet grabs all divs that have an id beginning with “proto_” and have a data attribute of “state” with value “open”. var $el = $(’div[id^=proto_]‘).filter(function() {      return ($(this).data("state")…

Continue reading →

jQuery.data() with HTML5 Custom Data Attributes

This is how you might go about using the new HTML5 Custom Data Attributes feature available in HTML5 with the jQuery.data() function. It is very useful for adding data into a page and passing custom settings for DOM elements into JavaScript for some initialisation code…

Continue reading →

jQuery Array Search Simple Example

Quick example on how you can use jQuery’s $.map() function to grab a value from an array of JS objects. In the example I have an array of JS objects that contain days and prices, we want to extract a price for a specific day.

Continue reading →

jQuery set value on specific table cell

Helper JS function which sets the price on a specified table cell based on the table id, row id and column number.

Continue reading →

jquery sort array by index

Quick example on how to use JavaScript to sort arrays by index values. To analyse the best method of doing this in terms of performance I looked at a JS perf test for sorting objects.

Continue reading →

Page 1 of 3 1 2 3
scroll to top