The problem of each function parameter passing in jquery

Source: Internet
Author: User

All know that each function is a good way to traverse, but sometimes it is necessary to pass some parameters in, then there is a problem.

1. Pass the array.

var obj = {one:1, two:2, three:3}; Each (obj, function (key, Val) {alert (key); alert (val);}); Where obj is the array of arguments we want to pass, key is the index of the array, Val is the value of the array


2.dom element Parameters

If you have a code like this in the DOM
?

1 2 3 4 < input name = "AAA" type = "hidden" value = "111"/> < input name = "BBB" type = "hidden" value = "222"/> &L T Input name = "CCC" type = "hidden" value = "333"/> < input name

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.