jQuery selectors with variables

前端 未结 5 1137
闹比i
闹比i 2020-11-22 10:24

How to mix variables with selectors?

I have ID variable.

I want to select image with this id from div #one.

jQuery(\'#one img .id\') is

5条回答
  •  礼貌的吻别
    2020-11-22 10:44

    Maybe you want to select img which set with specific class and save this class into id variable within div element with id='one'.

    DEMO

    In demo i select img element, clone it, and append to div id=one.

提交回复
热议问题