All Questions
Tagged with removeclass or jquery
1,034,203 questions
-4 votes
1 answer
31 views
jQuery .addClass not adding the class [closed]
In a WordPress page editor HTML block I have: <script> jQuery(document).ready(function() { jQuery('.wp-block-button__link').addClass('sg-popup-id-2331'); }); </script> However, ...
0 votes
0 answers
100 views
JQuery gallery with multiple instances not working
I have a webpage where I want to get multiple instances of the same JQuery-powered gallery tool. The first instance works just fine; all the individul items are clickable, the arrows work, and moving ...
-6 votes
2 answers
124 views
submitting form and using preventDefault() in validation but can no longer submit form after validation is addressed php/jquery
I am trying to submit a form and validating data using jquery by calling preventDefault() when it's incorrect. After addressing the validation error, what I want is to submit the form when the submit ...
-2 votes
0 answers
81 views
Delay when dragging an HTML element when using touch [closed]
I have written a 1 page letters game in HTML/JS/CSS. I am using jQuery. Part of the game is to drag a letter tile (<div>s) across the board over another tile, and the 2 tiles change place. The ...
Advice
0 votes
1 replies
34 views
How to toggle icon/image of Bootstrap button with jQuery and data attributes?
I have this button that toggles it's text from "Show more..." to "Show less..." whenever it's clicked: <button class="btn btn-sm btn-secondary" title="...
Best practices
1 vote
7 replies
115 views
HTML: set onclick event handler in external script file before user clicks it?
I am removing inline JS from HTML files due to CSP in an existing project, so this old code: <input value="Click here" type="submit" name="submitA" onclick="...
Advice
1 vote
23 replies
292 views
How can I deal with this javascript variables problem?
I have a quiz with 5 questions with a couple of answers you can choose from each, it's always single choice, so you will have 5 variables in the end, one per question q1="",q2="", ....
Advice
1 vote
17 replies
207 views
How should I share, save and combine JavaScript variables across HTML sites?
I am passionate about writing a personality/psychology/dating website. I know how to use variables a bit, but I don't know which is the best way to store them. There are cookies, sessionstorage and ...
1 vote
0 answers
89 views
how to use lightGallery v1.10 with vite and Laravel 12?
I am trying to add lightGallery v1.10 into a Laravel project with Vite. The following is my bootstrap.js file: import $ from 'jquery'; import jQuery from 'jquery'; window.$ = $; window.jQuery = ...
0 votes
3 answers
75 views
Disable Submit button *after* jquery.validation
I am using jquery.validation in an ASP.NET MVC form and would like to disable the submit button when jquery.validation passes and form actually submits. The validation triggers in the background (I am ...
Advice
0 votes
6 replies
74 views
I want to know if there exist a shorthand for .on() -> 'input' in jQuery
I am trying to display the updated length of the input username by a user. I know that we can use .change() shorthand but it updates after the span has lost focus. I want something to update it ...
1 vote
2 answers
69 views
Jquery accordion : how to call only once
I have many accordion elements that are added by an ajax function. When the elemet is created in ajax i call the function: $( ".accordion" ).accordion({ active: false, collapsible: true, ...
Advice
2 votes
1 replies
199 views
How do I make fully customisable home page for user
I am trying to make a fully customisable home page for the user. The idea is for it to be like OBS. You can add or remove windows to your home page, and you can resize them so each window takes up the ...
0 votes
0 answers
24 views
Triggering Change Event in Leaflet and jQuery [duplicate]
I am using leaflet.js to create a map and add a select box to the map. That works, but the change event, which used to work, does not work anymore. I start by creating the two objects that I need, the ...
1 vote
1 answer
106 views
Moving div to a sibling div
I am struggling to move a span from a sibling div to the previous one - I think my syntax is not quite as it needs to be… it works in that it moves the span to the location I need, BUT - as I have ...