Find nested element in query

后端 未结 5 1728
生来不讨喜
生来不讨喜 2021-01-15 09:19

I need to find an DropDownList with class addressControlCountry. How?

相关标签:
5条回答
  • 2021-01-15 09:41

    Try this

    $('#myDiv').find('.addressControlCountry');
    
    0 讨论(0)
  • 2021-01-15 09:43

    You can use

    $('#divLegalAddress).children()

    If divLegalAddress has more than one children you may use .eq()-function to pick the right one.

    0 讨论(0)
  • 2021-01-15 09:43

    You can scope by the outer div and then select the inner dropdown element as given below

    $('.addressControlCountry','#myDiv')

    0 讨论(0)
  • 2021-01-15 09:56

    What you already have should work, in theory. However, you could try one of the following:

    $('#myDiv').children('.addressControlCountry')
    $('#myDiv > .addressControlCountry')
    
    0 讨论(0)
  • 2021-01-15 09:59

    Please use this

    $('#myDiv > .addressControlCountry')
    
    0 讨论(0)
提交回复
热议问题