All Questions
Tagged with jquery-events jquery-selectors
94 questions
0
votes
0
answers
35
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
1
answer
29
views
jQuery.on() for children with no particular selector
I have HTML structure like this:
<div class="parent">
<div class="child">
<div class="something">...</div>
</div>
<...
1
vote
1
answer
126
views
The event won't trigger when I use a variable for a selector
<html>
<body>
<h1>RECEIPT</h1>
<datalist id="codes">
<?php
require_once('../../../mysqli_connect.php');
$query = "SELECT DISTINCT itemcode FROM ...
1
vote
2
answers
161
views
Selecting all elements except for div not working with jQuery
I'm trying to select all elements in the document except for the #private_chat_menu element and attach a mouseup trigger function to them. However, it runs the function regardless of whether I click ...
0
votes
1
answer
53
views
How to stop toggleclass on parent when child li gets pressed?
This is my HTML:
<ul id="menu-mobile" class="menu menu-sliding">
<li>
<a href="javascript:void(0);">Home</a></span>
</li>
<li class="has-children">
...
0
votes
2
answers
2k
views
Jquery double click event is not working
My requirement is to just double click a button.
HTML:
<button id="btn-db" class="dbBtn" ></button>
Solutions tried:
$("#btn-id").trigger("dblclick");
is not triggering double click ...
2
votes
2
answers
12k
views
Checkbox on change is not firing
I got a check box on the html page as:
<input type="checkbox" id="chk-info" name="chk-info" />
when I try to write an on change event and run, it's not getting fired. Instead if, I ...
-1
votes
4
answers
80
views
jQuery: "on" click event not working in table [duplicate]
I know that this question is duplicate. I read other question and answers but cannot get any result.
I have a dynamic table:
HTML
<table id="networklist" class="table table-hover">
<...
0
votes
2
answers
85
views
Change color of box to random array element on an event
Hello I have made this peace of code in order to change the color of a box, when ever the mouse enters it's area. there is an event on mouseenter and i have made a function which should return a ...
0
votes
3
answers
3k
views
How to select a specific <li> with jquery get the attr value of value and display it on the website
I have an assignment that goes as follows:
Create an event listener so when you click any list item the value of its "value" attribute will be displayed next to this line.
I have in my HTML and ...
0
votes
2
answers
2k
views
jQuery targeting nested list
What I'm trying to achieve at first is to test if an "li" has an "ul" nested within, and if so, to show the nested "ul" on click. this is working well; HOWEVER, the if statement is returning true for ...
0
votes
2
answers
421
views
jQuery: wrapAll() span elements while retaining white space
I have a text with each word wrapped with a span element to make them clickable. I want to be able to highlight a section of the text by clicking the first and the last words to be highlighted and ...
1
vote
1
answer
99
views
Read only <input> prevents adding value to different element
I have a series of <input> elements and a corresponding script that auto focuses the next box after typing. In addition there is a readonly element that there purely to provide context to the ...
-2
votes
1
answer
70
views
What is the best practice for passing arguments to event handlers? [closed]
Consider the following block of HTML:
<button id="follow-user1" class="btnFollow">Follow User1</button>
<button id="follow-user2" class="btnFollow">Follow User2</button>
<...
1
vote
1
answer
59
views
How to create a function containing custom var
I have written the following function to sync some input fields:
$(".dp1").on('change', function(e){
var dateValue = $($(this)[0]).val();
$.each($('.dp1'), function(index, item){
$(...