简体   繁体   中英

How do I use a jquery method on a variable when the same method exists in Javascript?

Specifically, I want to call the .which function on a character without having to discriminate browser types by using the jQuery .which method, which I am told normalizes for browser differences. However, the innate javascript method also exists, so if I called character.which, I would get the javascript .which keycode instead of the jquery one (presumably). Do I use $(character) .which or $("character") .which or will this not work at all? What's the syntax?

The jQuery is bit different in terms of Syntax as if you are using jQuery the process is:

$("ELEMENT_TO_BE_PROCESSED").FUNCTION/OBJECT;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM