Tell us what’s happening:
I am working on my project and trying to use jQuery to make a simple alert box when the button is clicked.
However, this doesn’t work and I don’t get what I am doing wrong.
I imported jquery in code pen using google online source and used the codepen editor import function itself. Did not help.
The only thing i can think of is the double name but if i change this the button: button element gets conflicted and stops to work.
@KittyKora
selectors here need to be closed with quote mark . Moreover button1 will not work here; if it’s a class or id make sure to use proper use of class and id selectors with jQuery- hope this will help you
// way to work with a class
$('.my-class').click();
// way to work with an id
$('#my-id').click();
// way to work with elements
$('button').click()
// or
$('a').click()
// see the above examples
// hope you'll get the main point