Using the jQuery $ prefix with TypeScript -


i'm trying cast html input control htmlinputelement in typescript. trying access input control through normal shorthand jquery method,

e.g. <htmlinputelement> $("#comparetocontrol") 

results in squiggly red line error "neither type jquery nor type htmlinputelement assignable each other.

is there way of getting work, or forced use old longhand way of referencing controls e.g.

 <htmlinputelement> document.getelementbyid("comparetocontrol"); 

that because $(expn) not return dom element instead returns jquery object , not assignable each other. need dom element jquery object of type htmlinputelement. i.e

<htmlinputelement> $("#comparetocontrol")[0] 

the typing declaration $(expn) using follows. ($ of type jquerystatic)

interface jquerystatic {      /**      * accepts string containing css selector used match set of elements.      *      * @param selector string containing selector expression      * @param context dom element, document, or jquery use context      */     (selector: string, context?: jquery): jquery; } 

Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -