-
Loop Syntax in jQuery
jQuery 3.0 is the most newest version of jQuery. There are many changes in it, but one of the important change
is the syntax of loop using for..of loop.For example earlier we use the syntax shown below:-
var $divelements = $("div");
for (var x=0; x< $divelements.length; x++){
$divelements[x].addClass("dummy");
}Here's the new syntax:-
var $divelements = $("div");
var i = 0;
for(var elm of $divelements) {
elm.addClass("dummy");
}With the help of this new syntax, you will get DOM elements, instead of jQuery collection. You not need to use index to get element, it will be directly accessible to you.
-
This discussion was modified 9 years, 8 months ago by
Sourabh.
-
This discussion was modified 9 years, 7 months ago by
Forcetalks.
-
This discussion was modified 9 years, 8 months ago by
Log In to reply.
Popular Salesforce Blogs
Salesforce Duplicate Management Became Easier
Peeklogic Smart Duplicate Manager. Salesforce Duplicate Management Became Easier Peeklogic helps to provide configure, modernize, and customize solutions for the Salesforce business. Peeklogic uses development…
Learn All About Salesforce Multi-Factor Authentication
Do you know the reason users are switching to iOS over Android? UI and UX are great. However, security is the primary reason. We live…
Salesforce Financial Services Cloud | Empower your borrowers with Mortgage Innovation
Loans and Mortgages are key elements of today’s economy and there is a likelihood that every adult at some time or other has been part…
Popular Salesforce Videos
Install Adobe Sign & Send Agreements For E-sign in Salesforce
Learn the steps involved in installing Adobe Sign and sending agreements for e-sign in Salesforce. This tutorial will cover the following points - 1. Install…
A Year of Innovation and Growth for Kizzy Consulting - Top Salesforce Partner!
2023 was an amazing year for Kizzy Consulting - Top Salesforce Partner! We achieved the status of Salesforce Ridge Partner, completed numerous Salesforce certifications, and…
How to import data from Sage ERP to Salesforce - Part 1
Greytrix offers GUMU™ integration for Salesforce with Sage ERP systems - a best-of-breed solution for organizations to enhance their customer interaction. With Salesforce and Sage…