Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. $(document).ready(function() {
  2. $("button[name='21'],
  3. button[name='22'],
  4. button[name='23'],
  5. button[name='24'],
  6. button[name='25']").click(function(){
  7. var target = $(this).attr("name") - 20;
  8. $("#ID").prop("selectedIndex", target);
  9. FUNCTION();
  10. });
  11. });
  12.  
  13. function ButtonTemplate(indx, menuID, fxn_to_run){
  14. $(document).ready(function() {
  15. $("button[name=" + "'" + toString(indx) + "'1']",
  16. "button[name=" + "'" + toString(indx) + "'2']",
  17. "button[name=" + "'" + toString(indx) + "'3']",
  18. "button[name=" + "'" + toString(indx) + "'4']",
  19. "button[name=" + "'" + toString(indx) +
  20. "'5']").click(function(){
  21. var target = (this).attr("name") - (indx * 10);
  22. $(menuID).prop("selectedIndex", target);
  23. fxn_to_run;
  24. });
  25. });
  26. }
  27.  
  28. ButtonTemplate(2, "#ID", FUNCTION());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement