How can I stop “property does not exist on type JQuery” syntax errors when using Typescript?

后端 未结 7 1258
天涯浪人
天涯浪人 2020-12-01 04:09

I am only using one line of jQuery in my application:

$(\"div.printArea\").printArea();

But this is giving me a Typescript error:

7条回答
  •  时光说笑
    2020-12-01 04:39

    You can also write it like this:

    let elem: any;
    elem = $("div.printArea");
    elem.printArea();
    

提交回复
热议问题