jquery gets all objects of the same attribute under a div to loop on its action

Source: Internet
Author: User

$(function () {            vari = 1; $("Div. Datapartfull "). each (function(index, Element) {varIndexID = $element). Find ("input[type= ' hidden ']"). EQ (0). Val (); varSetype = $ (Element). Find ("input[type= ' hidden ')"). EQ (1). Val ();//Line chart or bar chart                //if the Setype in the database is empty, the default is bar chart                if(Setype = =NULL|| Setype = = "") Setype = "Bar"; varMyChart = Echarts.init (document.getElementById ("main" +IndexID), theme[i]);                mychart.setoption (option);                Getajaxchartdata (IndexID, MyChart, Setype); I++;            }); varFirstindexid = $ ("#ctl00_ContentPlaceHolder1_hidIndexid"). Val (); varFirstsetype = $ ("#ctl00_ContentPlaceHolder1_hidSertype"). Val (); if(Firstsetype = =NULL|| firstsetype== "") Firstsetype = "Bar"; if(Firstindexid! =NULL) {                varMyChart = Echarts.init (document.getElementById ("main" + Firstindexid), theme[0]);                mychart.setoption (option);            Getajaxchartdata (Firstindexid, MyChart, Firstsetype); }        }); 
        function Getxian (Strshi)        {            $ ("#ShiList a"). Removeclass ("cur");            $ ("#ShiList a"). each (thefunction  (index, Element)                {if ($(this). attr ( "id") = = "Shi" + Strshi) {                    $ (this). AddClass ("cur");}            );         } 

The above two instances are a way to loop multiple objects with the same characteristics under a DIV and perform related operations

jquery gets all objects of the same attribute under a div to loop on its action

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.