Title / Description
Code function change_quantity(item_id, submit_id, op='+') { var d=document; var item=d.getElementById(item_id); var v = parseInt(item.value); v = isNaN(v) ? 0 : v; if (op == '+') { v++; } else { v--; if (v <= 0) { v = 0 } } item.value = v; submit=d.getElementById(submit_id); submit.click() }
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code