DEV Community

Cover image for From jQuery to JavaScript – How to make the move 🌠

From jQuery to JavaScript – How to make the move 🌠

webdeasy.de on June 12, 2020

Originally published on webdeasy.de! Moving from jQuery to JavaScript offers several advantages. Besides removing dead code, you can also increase...
Collapse
 
olton profile image
Serhii Pimenov

jquery is not just about fetching elements and attaching event handlers. You showed maybe 1% of all jQuery features.

Collapse
 
gijovarghese profile image
Gijo Varghese

He wrote a blog post, not a JavaScript lib for jQuery!

Collapse
 
webdeasy profile image
webdeasy.de

I know. And I wrote that this are the function I needed to move my website from jquery to js. I never said that this are all functions 😉

Collapse
 
olton profile image
Serhii Pimenov

I also tried to abandon jquery in my project - Metro 4, from this process I got the - M4Q library ðŸĪŠ

Thread Thread
 
soumendudas22 profile image
Soumendu Das

Never heard of M4Q, just saw it has a weekly download of 1!

Collapse
 
silvervision profile image
Silver vision

Yes this is possible to convert jquery to javascript but its very difficult to manage everything in javascript.I also try a lot to convert it at the end i found one online tool that convert jquery to javascript easily.The tool is workversatile.com
workversatile.com/jquery-to-javasc...

Collapse
 
webdeasy profile image
webdeasy.de

I tried two codes snippets, but it doesn't seem to work....
If that really works, it would be insane!

Collapse
 
silvervision profile image
Silver vision

Can you please give me your snppets?

Thread Thread
 
webdeasy profile image
webdeasy.de

I tried this:

$('p').click(function() {
alert('test');
});
Enter fullscreen mode Exit fullscreen mode

It gives me the same output.. :c

Thread Thread
 
silvervision profile image
Silver vision

What is p?
Id or class so please # or . Before p and try.

Thread Thread
 
webdeasy profile image
webdeasy.de

That's working, great!
But p oder h2 or something like that should work. This selects all p (or h2) on the page

Thread Thread
 
silvervision profile image
Silver vision

Yes its correct i will contact owner of this tool and reply here.

Thread Thread
 
webdeasy profile image
webdeasy.de

I will test it more, but it already looks good

Collapse
 
soumendudas22 profile image
Soumendu Das

What I feel is jQuery and JS both are good only if someone wants to write less code picks jQuery(or if the project is already written in jQuery xD) else vanilla JS.
For me I prefer JS more than jQuery.

Collapse
 
webdeasy profile image
webdeasy.de

Absolutely. It always depends on the project.

Collapse
 
mgparisi profile image
Michael Parisi

I got a convertor over on my website. It's completely free.
properprogramming.com/tools/jquery...

Feel free to use it. It can help with the conversions.