简体   繁体   中英

Jquery fails in chrome extension if a page or website have already a version of jquery. I want Jquery Selector script

i want jquery selector script. but i don't want to use jquery library.

i am building a chrome extension. when i use jquery in extension so when it called in a page or website which is using already jquery then it fails. Don't tell me for jquery.conflict().

i want a library or script which performs like:

$("#some").val()
$("some").val()
$(".some").val()

Atleast all possible functions, or minimum setAttributeValue() I think you got it what i want...

Just use the native .querySelector() or .querySelectorAll() methods to select the elements, then use the native .value property or getAttribute() method to retrieve what you need. Loading a library for this is like cracking a nut with a sledgehammer.

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