Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $("button[name='21'],
- button[name='22'],
- button[name='23'],
- button[name='24'],
- button[name='25']").click(function(){
- var target = $(this).attr("name") - 20;
- $("#ID").prop("selectedIndex", target);
- FUNCTION();
- });
- });
- function ButtonTemplate(indx, menuID, fxn_to_run){
- $(document).ready(function() {
- $("button[name=" + "'" + toString(indx) + "'1']",
- "button[name=" + "'" + toString(indx) + "'2']",
- "button[name=" + "'" + toString(indx) + "'3']",
- "button[name=" + "'" + toString(indx) + "'4']",
- "button[name=" + "'" + toString(indx) +
- "'5']").click(function(){
- var target = (this).attr("name") - (indx * 10);
- $(menuID).prop("selectedIndex", target);
- fxn_to_run;
- });
- });
- }
- ButtonTemplate(2, "#ID", FUNCTION());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement