Skip to main content

All 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. ...
Tahir Aziz's user avatar
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> <...
1234ru's user avatar
  • 792
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 ...
Cloyd's user avatar
  • 11
1 vote
2 answers
159 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 ...
Daniel Harris's user avatar
0 votes
1 answer
51 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"> ...
Sayantan Chandra's user avatar
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 ...
Magesh's user avatar
  • 308
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 ...
John M's user avatar
  • 201
-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"> <...
Soheil Alizadeh's user avatar
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 ...
Jacob Jensen's user avatar
0 votes
3 answers
2k 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 ...
Jacob Jensen's user avatar
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 ...
d.b's user avatar
  • 3
0 votes
2 answers
416 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 ...
TwoRE's user avatar
  • 57
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 ...
m.edmondson's user avatar
  • 30.7k
-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> <...
IeuanG's user avatar
  • 504
1 vote
1 answer
57 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){ $(...
Marian Rick's user avatar
  • 3,380

15 30 50 per page
1
2 3 4 5
7