skip to Main Content

How to apply currency validation to text box using a regular expression? – Jquery

Consider this form: <form> <input type="text" value="" placeholder="Enter no. of employee" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(..*)./g, '$1');" required/> <input type="text" value="" placeholder="Enter Salary" required/> <input type="submit"/> </form> I want a regular expression validation for Enter salary text feild with following: The…

VIEW QUESTION

A jquery function to decrease font size each time a button is pressed

Please help. function fontDown() { var curSize = parseInt($('.box').css('font-size')); curSize--; $('.box').css('font-size', curSize + "pt").css('line-height', curSize + "pt"); } <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <button onclick="fontDown()">button</button> <div class="box" style="font-size: 14pt; line-height: 14pt;">sometext</div> I expect the font-size to decrease each time I press the button.…

VIEW QUESTION

Do something in jQuery repeatedly on all children of a parent

I've got following code: (function($) { $(".tmb:first-child").on('mouseenter', function() { $(".style-light-bg").css("background-color", "rgb(208,206,202)"); $(".tmb:nth-child(2)").addClass("filtered"); }); $(".tmb:first-child").on('mouseleave', function() { $(".style-light-bg").css("background-color", "#e6e5e2"); $(".tmb:nth-child(2)").removeClass("filtered"); }); $(".tmb:nth-child(2)").on('mouseenter', function() { $(".style-light-bg").css("background-color", "rgb(177,180,174)"); $(".tmb:first-child").addClass("filtered"); }); $(".tmb:nth-child(2)").on('mouseleave', function() { $(".style-light-bg").css("background-color", "#e6e5e2"); $(".tmb:first-child").removeClass("filtered"); }); })(jQuery); .style-light-bg { background-color: #e6e5e2; transition:…

VIEW QUESTION
Back To Top
Search