Find an element by CSS selector in GWT

后端 未结 5 1889
不思量自难忘°
不思量自难忘° 2021-01-11 09:21

I\'m trying to grab an arbitrary element using a CSS selector (eg. \"#someId .className a\") in GWT.

I\'m building a JS widget that can live on a 3rd party website a

5条回答
  •  南笙
    南笙 (楼主)
    2021-01-11 09:36

    Inspire by Asfand Yar Qazi answer.

    With JSNI you can just define this method and enjoy it when you web app is running in modern browsers.

    public final native NodeList querySelectorAll(String selectors) /*-{
     return $doc.querySelectorAll(selectors);
     }-*/;
    

提交回复
热议问题