How do I get a jQuery selector's expression as text?

后端 未结 9 1263
迷失自我
迷失自我 2020-11-30 10:36

I have a jQuery selector, which has a chained function.

Inside the function I want to get access to the TEXT representing the expression for the selector.

         


        
9条回答
  •  佛祖请我去吃肉
    2020-11-30 11:29

    Maybe this solve your problem :

    var $jqueryItems = $( ".my-selector" );
    console.log( $jqueryItems.selector ); // display ".my-selector"
    

提交回复
热议问题