Title / Description
Code <form action="" method="POST" id="payment-form"> <div class="form-row"> <label>Card Number</label> <input type="text" maxlength="20" autocomplete="off" class="card-number required" /> </div> <div class="form-row"> <label>CVC</label> <input type="text" maxlength="4" autocomplete="off" class="card-cvc required" /> </div> <div class="form-row"> <label>Expiration</label> <div class="expiry-wrapper"> <select class="card-expiry-month required"> </select> <script type="text/javascript"> //populate the expiration month dropdown var select = $(".card-expiry-month"); for (var i = 1; i <= 12; i++) { select.append($("<option value='"+i+"'>"+i+"</option>")) } </script> <span> / </span> <select class="card-expiry-year required"></select> <script type="text/javascript"> var select = $(".card-expiry-year"), year = new Date().getFullYear(); for (var i = 1; i < 10; i++) { select.append($("<option value='"+(i + year)+"' "+(i === 0 ? "selected" : "")+">"+(i + year)+"</option>")) } </script> </div> </div> <button type="submit" class="submit-button">Submit Payment</button> </form>
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