Questions tagged [each]

An iterator function or language struct which can be used to iterate over arrays or lists.

A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties.

jQuery.each( array, callback )
// or
jQuery.each( object, callback )
3858 questions
1
vote
5 answers

How to return a variable with jQuery each function

This is my script (simplified): var $error = false; //Check for errors $('.required').each(function() { var $error = true; }); alert($error); How to make the above code return true in the alert function? The each function is executed 3 times at…
Rens Tillmann
  • 474
  • 2
  • 7
  • 21
1
vote
2 answers

How to append or prepend div text to be used several times on one page without repeating?

I want the "text complete" moved to the h3.title section .. When I use the following Jscript, the "text complete" is moved to the start of the div.caption. This element repeats several times on the page and needs to be specific to the closest…
1
vote
2 answers

jQuery change text of a div if it's sibling contains a certain string of text

So I know how to do something like this, but I have multiple elements that my .each(function() is running on, I need to make sure only .modules that contain spans with "Open 24 hours" trigger the change of the div to "ALWAYS OPEN" and I can't figure…
glasses
  • 743
  • 2
  • 8
  • 24
1
vote
3 answers

Increment image width by 50px

I have an image that appears multiple times, but I need the image width to increment by 50px each time it appears. I've tried to accomplish this with jQuery, but I'm having no luck at the moment, any ideas where I'm going wrong? The HTML that loops…
lukeseager
  • 2,365
  • 11
  • 37
  • 57
1
vote
2 answers

jquery hide extra dropdowns in a table

I have several tables on a page with the possibility of multiple dropdowns in each table. The table and the dropdowns are autogenerated. The tables I want to target have numeric ids and all of the values of the dropdowns will be numeric. HTML…
jessier3
  • 809
  • 1
  • 7
  • 16
1
vote
1 answer

Jquery Each Obj Loop

I am making an ajax call and returning an array of json data. I am then attempting to do an each on the object and create some HTML. success: function (data) { var abc = null; var obj = $.parseJSON(data); $.each(obj, function(key, value) { …
Matthew Colley
  • 10,816
  • 9
  • 43
  • 63
1
vote
1 answer

JQuery equal heights on click for individual expanded text

I have a page set up nicely (JSFiddle) with a photo and expanding bio when you click the persons name (e.g. "Jane Doe"). I'm using an equal heights plugin to keeps the columns to match each other, e.g.
Danny Englander
  • 2,005
  • 5
  • 26
  • 41
1
vote
2 answers

Reading value from list using jQuery each statement

I have this statement
  • A

    S

Bijaya Khadka
  • 159
  • 3
  • 6
  • 20
1
vote
1 answer

Sass - Nested @each loop and nth to grab separate values

I'm trying to write a CSS3 gradient mixin that also produces SVG for IE9. I want to pass in a large string (a list) of the nodes' colours and positions which are comma separated but also split these groups in to individual values for relevant SVG…
Matt Stow
  • 6,053
  • 6
  • 24
  • 26
1
vote
1 answer

each item in an array into each matched element

I am using $.getJSON to return a simple array such as: ["5","10","15","20"] I then want to prepend each of these values to an element. I understand how to iterate through the array and perform a function, such as: $(data).each(function(i,data){ …
Rory Dale
  • 55
  • 5
1
vote
2 answers

JQuery Each function with ajax loop

Hello guys this is my very first post in this forum. I have this function function TestePresenca(){ var msg = '' $('#teste tbody tr').each(function(){ var MemberId; var ClassId; var PresenceDate; var OClasse; var DataPre =…
1
vote
3 answers

jQuery seed each() with an array of elements

The script below is throwing an error (customfields is not defined). Do I need to pass the element IDs differently? I'm trying to seed the array with the form fields that I'm looking to calculate. It should iterate through each of the form fields in…
js-newb
  • 421
  • 6
  • 16
1
vote
1 answer

Powershell DataGridView - looping through rows in checkbox column to see if checked

I'm trying to create a powershell form that will get all processes into a datagridview (which works OK so far). I'm then adding an additional column infront of the datasource with each row as a checkbox. I'd then like to press a button on my form…
user2279244
  • 11
  • 1
  • 1
  • 5
1
vote
2 answers

Jquery help: .click() to each individual element

I've written up this code to add a class (.box-open which adds display:block) to my box (.sharebox) when a button (#share-but) is clicked but the problem is I'm having trouble making this only apply to one .share div at a time because everytime I…
Kevin
  • 15
  • 2
1
vote
1 answer

jQuery assign sticky attributes using each function

I am building a product configuration page using jQuery and I need to be able to change the colour of the product, in this case a shoe, when the user chooses the corresponding colour option. Each shoe has four component parts that can be specified…
1 2 3
99
100