Reputation: 1056
I try to implement my own button into SVG Editor. Svg editor has many buttons with ID's and funcionality. Now I would like to implement more buttons on one page with different IDs but with the same funcionality as original button. Because of tons of code in svg editor is hard to find and implement all events of other buttons on right places. Exist any way to implement something like "ID alias" ? So that i create button with new ID and it will have same function as button with original ID ?
Upvotes: 0
Views: 388
Reputation: 964
As Lelio suggested you should set a class on all the buttons you want to share functionality.
<button class="classname">Press me</button>
You can then access them easily using jquery;
$(".classname")
You prepend the name with a . to match on the class, or a # to match on the ID field.
Upvotes: 2