Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Amit Sarker
Added: Mar 8, 2018 7:36 AM
Views: 14
Tags: no tags
Different type of JS functions
  1. $(".purchase_price").on("keypress keyup blur", get_numeric_value_input);
  2. function get_numeric_value_input(event) {
  3.     $(this).val($(this).val().replace(/[^0-9\.]/g, ''));
  4.     if ((event.which != 46 || $(this).val().indexOf('.') != -1) && (event.which < 48 || event.which > 57)) {
  5.         event.preventDefault();
  6.     }
  7. }
  8.