I have a button with class try and when its clicked there is a function that is being called, now I want to create a button called start that will do the same, and I don’t want to copy paste whole code in that button click handler, is there a way to say lets say if try or start do the following in jquery?
I have a button with class try and when its clicked there is a
Share
I assume that since you said
a button called startthatstartis the id. That is why I am using a#instead of a.to reference it.if
startis the class, then use this.#indicates an id, while.indicates a class.