My application is for renting cars and I’d like to be able to have a user enter the number of passengers that they require and then dynamically show a list of cars that are available that are capable of carrying the desired number of passengers. I have all the backend logic build in Java and ..
Category : jquery
I have this button. I just noticed, if I have the same class name on two nested elements, the click listener will fire twice. When I click, how can I fix this? $(‘body’).on(‘click’, ‘.remove’, function(e) { e.preventDefault(); if ($(e.target).hasClass(‘remove’)) { console.log(‘test’); //executed twice here } }) <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js”></script> <button type=”button” class=”btn remove “><i class=”fas fa-trash ..
how can this particular code work on page load itself and even on refresh of page timer value remains ticking only when click submit it stops? can someone please help me out here? really need your expertise to achieve this i guess we need to store the timer on localStorage and destroy storage on click ..
I need to resolve simple task. I have 5 divs and have 2 buttons for each of them (one will increase the value, 2nd – will decrease). I need to resolve this task via jquery. The problem is, that all divs have shared counter, I need to create separate for every div. Please advice. <script> ..
I have this div.form-group dynamically added. I have index given to delete. my problem is that when I delete an elment in index 1 the third div also is deleted. how can I delete only one div by the given index <div class="mycontainer"> <div class="form-group"> <input type="text" class="form-control"> </div> <div class="form-group"> <input type="text" class="form-control"> </div> ..
I use this jquery code to show parts in tabs: <script> jQuery(document).ready(function ($) { $(".tab_content").hide(); $(".tab_content:first").show(); /* if in tab mode */ $("ul.tabs li").click(function() { $(".tab_content").hide(); var activeTab = $(this).attr("rel"); $("#" + activeTab).fadeIn(); $("ul.tabs li").removeClass("active"); $(this).addClass("active"); $(".tab_drawer_heading").removeClass("d_active"); $(".tab_drawer_heading[rel^=’" + activeTab + "’]").addClass("d_active"); $(".tab_content").hide(); var d_activeTab = $(this).attr("rel"); $("#" + d_activeTab).fadeIn(); }); /* if in drawer ..
I’m using navigator.geolocation on page load. It works fine but only for desktop, for mobile chrome, it doesn’t work fine. It throws error User denied location if my mobile location is turned off. And if my location is turned on then it ask for allow website to access your location. Let me explain: Turn off ..
I have used the following code from https://www.w3schools.com/howto/howto_js_slideshow_gallery.asp to create this slideshow gallery. But I have a problem with having more than one slideshow on one page, and therefore would ask if any of you had an idea to write a script for this? HTML: <!– Full-width images with number text –> <div class="mySlides"> <img ..
my jquery functions not working after call calcBtnDisplacer(); this function swap two div with each other. here is my html : <section id="sec1Nd"> <label class="calc-label">Price<span class="input-required">*</span></label> <input type="text" name="amount" class="calc-input calc-amount"> </section> <section id="sec2Nd"> <label class="calc-label">Value<span class="input-required">*</span></label> <input type="text" name="amount" class="calc-input calc-amount-value"> </section> and here is my function : function calcBtnDisplacer(){ var sec1Nd,sec2Nd,amount,value,timer; amount = ..
INTRODUCTION I am using Bootstrap v4.6, jQuery latest and jquery-validation latest, in Symfony v5.2 project to validate user inputs. EXPECTATION I would like the validation to look the same – eather with JavaScript or PHP. STEPS TAKEN For that i took an example jquery-validation on GitHub I followed the example – yet part of error ..
Recent Comments