DEV Community

Discussion on: From jQuery to JavaScript – How to make the move 🌠

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