Questions tagged [jquery-events]
These methods are used to register behaviors to take effect when the user interacts with the browser, and to further manipulate those registered behaviors.
3,384
questions
0
votes
0
answers
12
views
If I have multiple divs on my screen, and on click they all move to the right of the webpage. How can I determine which reached first?
I have a parent class of animal and multiple subclasses like, leopard, caracal and cheetah. They are placed on the web page once their respective buttons are clicked and when my button start is ...
-1
votes
0
answers
7
views
Redefine jquery-event function [duplicate]
I my code I need to redefine certain event function inside another event function. I've been trying the same way as in the code below, but after pressing "Click me" after pressing "...
0
votes
0
answers
25
views
queryEvents for a specific app running in the background
I try with queryEvents to know when a specific app is running in the background.
The problem is that it only works for foreground and not for background.
if (Build.VERSION.SDK_INT >= ...
0
votes
0
answers
34
views
Jquery to allow negative and positive numbers on text field and negative sign should have 0 indexes
I need to validate a text field to accept only negative or positive numbers and indexing also matters. this is what I have tried so far.
this is HTML code
<input type="text" class="...
0
votes
0
answers
41
views
Event removed_from_cart not triggered on cart page
I would like to get deleted product information when item is removed from cart. It works very well with mini cart, but event is not triggered when removing items on cart page.
I listen to the ...
1
vote
2
answers
68
views
JavaScript KeyUp() event for more than single-digit
I'm building this simple JavaScript project where if I input number N then it will show 1 to N. I'm using keyup() event for this. If I remove N from the input field then It will show nothing, which is ...
2
votes
1
answer
44
views
How can I set some values using currentTarget with jQuery from different HTML elements?
Can anyone give me a hand with this?
I am trying to obtain different values depending which button is clicked and assign it into a variable.
A friend told me to add the values in an input to later by ...
-1
votes
1
answer
21
views
jQuery append element keeps adding the element onclick
I am trying to append a custom element on click on parent menu items to child menu items. When I click to parent item the code adds the custom Element. But when I click on an empty space of children ...
0
votes
3
answers
95
views
Using JavaScript, how to change Header to an H3 if it nested inside an H2?
I have this component called topComponent that has a title, body, and link. The Title is an H2.
<div class="topComponent">
<div class="Wrapper">
&...
1
vote
0
answers
28
views
Android scrolling canceles Webview move events
I have Android activity with NestedScrollView and inside it I have Webview with some html and jQuery script.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
...
0
votes
0
answers
21
views
jQuery date time picker not working while changing the timer
datetimepicker is not working
I have a website where if the user clicks the button, then the timer which displays in the UI will get changed by 20 minutes,
but when I do that it is not working.
Here ...
0
votes
0
answers
33
views
How to check the list of events bound to an element by Javascript
I'm looking for a way to list all events added to a certain element by Javascript. I know getEventListeners is available in dev tools, but it is not available in script.
I know with jQuery, I can ...
0
votes
1
answer
19
views
Handling of jQuery event using class method changes context
is someway possible to get class context from the inside of its method which is used as jQuery event handler? Following example should explain everything:
class EventHandler {
constructor() {
...
0
votes
3
answers
67
views
How to find which js file creating problem
I have more than 20 js files like jQuery etc in my project, when I scroll it gets hung as it loads very lazily. How to find which file creates the problem?
0
votes
0
answers
71
views
Bootstrap5 modal inside modal show.bs.moda issue
I have a post modal and a stamp modal inside the post modal.
I opened the post modal for the first time and clicked the stamp button inside the post modal to bring up the stamp modal
It was processed ...
0
votes
1
answer
48
views
How do i switch the button icon from nightmode to day mode?
In the below code I have linked some js/jQuery to elements in my html which should be self explanatory. I have console logged each if else statement to see what the issue is and it seems to be stuck ...
0
votes
0
answers
65
views
Input with Javascript code plus and minus I need to fire event change on plus and minus
I have input with JavaScript code plus and minus, I need to fire event change on plus and minus click because I call ajax to update cart with the new quantity.
This code doesn't work : currentInput....
0
votes
2
answers
41
views
Find out which div was clicked and pass it to the click function handler?
I'm adding a list of child divs (cards) by looping through an array. I want to create an onclick event listener for each child div (card) of parent div (board).
$.each(cardArray, function(i,value){...
0
votes
1
answer
38
views
how can i use a book marklet to temporarily disable an event handler in my website?
i made a simple button clicker website in which every time you click the button, it adds to a counter. here is the url:
https://joeceb.w3spaces.com/button-clicker.html
the code was pretty basic and it ...
0
votes
1
answer
75
views
how do i use javascript to import jquery into the head of a document?
i made a script to import jquery into a website but for some reason it doesnt work.
this is it
function loadJQuery() {
let jquery = document.createElement('script');
let script = document....
1
vote
0
answers
68
views
Prevent Javascript caching $(document).keydown()
I have a list that I need to work with navigation buttons and after hitting enter it should run a function to execute ajax.
I load pages and my list inside (mainPage):
<div id="page_view1"...
0
votes
0
answers
38
views
Dynamic onclick event fileupload event
I want to add a dynamic onclick event on each file upload so that I can remove files at a particular index.
Multiple file upload working perfectly fine but now I want to remove particular file at ...
0
votes
2
answers
42
views
Affecting another outside element using CSS
I would like to attach a focus event listener to the first element and when it fires, then second element border will be red.
The first element is inside of the second element.
The problem: I cannot ...
0
votes
2
answers
441
views
How can I call a .NET MVC action on tab/browser close?
As a part of my MVC web application, I need to call a controller method when a browser or a browser tab is closed. I am using the Javascript onbeforeunload event for calling the method.
window....
0
votes
1
answer
217
views
limit input to 2 decimal places jquery onchange event [duplicate]
I want when user enter a number into input field like this 54.78987, or any number more than two decimal places, it should automatically go back to two decimal places like 54.78. Function can be use ...
0
votes
1
answer
45
views
Can we read real time value of parameters passed to callback function using “.apply”?
In my scenario, I have callback function that accepts some parameters (0 or more). I've declared an object global variable and passing this to my callback function and later in some part of code ...
0
votes
1
answer
48
views
Dragging map to the selected marker from the list line leaflet map
If I am on the list of agencies, and each time I click on the agency line, it will slide on the map to marker.
In this case, it do jump not drag on the map:
$("#myTable tr").hover(function ()...
0
votes
3
answers
403
views
How to play audio and video with same trigger
I want to use one play pause button for both tab. If you check the code, I have tried to play video and audio with same play pause button. But I can play only the audio with it, not the video.
If it ...
0
votes
1
answer
92
views
Owl carousel single item
When I use single item in owl carousel the loop doesn't stop. I want it to be stop for one item, and when I add other items it will start working. Following is my code:
$('.owl-carousel').owlCarousel({...
0
votes
2
answers
51
views
jQuery calling on() on dynamically generated it after calling click()
I am trying to develop some code to allow the user show/hide a block level element by clicking a button.
The HTML structure is like below
<div class="chat_container"><a class="...
0
votes
0
answers
108
views
Button click not firing in modal window
I'm using jQuery v3.6.0 and Bootstrap v5.0.2. I have a dynamically generated modal which has buttons. When the modal pops up, none of the buttons work and I cannot figure out why.
Here's what I have ...
0
votes
0
answers
81
views
Detect if number input tried to be above max
I have some third-party jQuery plugins that are binding events to a button with specific class.
I need to bind another event, but these events needs to be executed BEFORE any other events.
For example:...
1
vote
0
answers
54
views
Clicking On An Angular JS element with Javascript/Jquery (Tampermonkey) [duplicate]
I am writing a Tampermonkey script to add more functionality to an existing website and I am trying to click on a button with the following source code:
<label _ngcontent-c10="" ...
0
votes
1
answer
107
views
Trigger event in jQuery with params
I am using the django-autocomplete-light library to have a ModelSelect2 field in my form. I need to externally change the currently selected item. The library has a following code to handle the ...
0
votes
0
answers
69
views
Special Cursor change on hover
I have a function that creates a large circular circle that would like to be activated only when the cursor hovers the QrCide__Section... I am fairly new to coding. I think that using mouseover might ...
0
votes
0
answers
42
views
How to get a which marquee span is onStart marquee
I want to change a label when announcement 1 is on screen then label 1 is shown ... after that announcement 2 is is on and label 1 is hidden and label 2 is shown.
<marquee id="marquee_element&...
2
votes
1
answer
49
views
Make input radio change image when one clicks on each of them
I have a group of radio buttons that set to show image instead of normal radio button.
I want to change the image when each of them are checked. I wrote the jQuery and it works but it doesn't return ...
2
votes
1
answer
64
views
Make text item invisible of DropDownList-A when a item of DropDownList-B is selected
Dropddown List A has 2 items, this DropddownList has no dependency on another dropdown list
Dropddown List B has 8 items, this DropddownList has dependency on DropddownList A
Items can be selected ...
0
votes
0
answers
83
views
JQuery multiple click listener on same element (#id) how to stop others from execution
I have a menu whose click event is listen from a library using below piece of code.
$("#Menu li a").click(function () {
let menuValue = $(this).attr("value");
// Route ...
0
votes
0
answers
34
views
Jquery html function not working properly until remove called [duplicate]
I am facing a problem where $('element').html('<p>Some HTML</p>'); is not working properly. After executing $('element').remove(); function the $('element').html(); is working fine.
...
0
votes
0
answers
176
views
Console error in Chrome Dev Tools console points to the wrong line of code as the origin of error
I'm working on a Shopify site, adding jQuery and JavaScript to customize the site to the clients needs. Whenever a JavaScript error pops up on the Chrome Dev Tools console it shows which line the ...
0
votes
0
answers
112
views
How to reload an iframe in Javascript? [duplicate]
I am trying to reload an iframe. Normally the code is achieved without iframe via below code:
window.location.reload(true)
<iframe src="https://maps.google.com/maps?f=q&source=s_q&...
1
vote
1
answer
214
views
Add Mouse Event to all Child Elements in DIv
Here is what I am trying to do:
$(window).mousedown(function(e) {
switch (e.which) {
// left click
case 1:
e.preventDefault()
$(e....
0
votes
0
answers
140
views
Why first click not working, but works on second click in javascript?
I have Jquery Code for search suggestions,
HTML Code:
<div class="search-section">
<div class="search-inner">
...
1
vote
2
answers
119
views
How can HTML <output> element changes trigger further events?
Details
I have an example, where input and output elements are on the same site.
The <output> element value is generated
The <input> element value is given by the user
There is another &...
0
votes
1
answer
50
views
How to change the order of events when they are set via the .on method?
How to change the order of events when they are set via the .on method?
It turns out to change the order only for directly installed handlers
Example: https://jsfiddle.net/Bozon/3gcea2q1/8/
I was ...
0
votes
1
answer
45
views
How to submit the form one time after multiple success response Ajax
In my project I'm uploading multiple images to a product and I append the uuid's of the images from the response in hidden fields within my form.
I need to submit the form only one time when I get all ...
1
vote
1
answer
42
views
Combine Multiple Click and Keypress Functions - Jquery Optimization
What I am doing: I've created a troubleshooting guide where you have multiple choice options that you click or press a key in order to move on to the next section in the guide.
What I need Help with: ...
0
votes
0
answers
39
views
JQuery DateTimepicker allow user text input
How do I use a jQuery Datetimepicker with a user textbox input?
$(document).on('click', '#txtUserDateTime', function (evt) {
$('#txtUserDateTime').datetimepicker({
...
0
votes
0
answers
289
views
How to open keyboard on focus() event of textbox in mobile chrome browser
Trying to focus on a simple input text when the page loads with jQuery events, my target is to focus and open the keyboard on mobile browsers but it's not working.
My code looks so simple as:
$('#...