Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
-1 votes
0 answers
63 views

jQuery: onclick event works only the first time

Trying to add two event handlers on two elements respectively. The second element will only appear in DOM after users clicks the first element. My problem is the first event handler only work for one ...
Jane Lim's user avatar
2 votes
1 answer
379 views

Add different sounds to different buttons

I am working through a project using Javascript and jQuery. The projects requires me to add sounds to buttons. A different sound should play depending on the button I click. I know how to add a single ...
Leslie W.'s user avatar
1 vote
0 answers
23 views

what is the best jsript event handler to use when data is change through other script for select? [duplicate]

I am trying to make, the value for the value media and unit media, change when the object is select, yes the object do change when I change upon the available item to select, but my target is to ...
Muhammad Faiz Abdullah's user avatar
1 vote
1 answer
137 views

eventHandler trigger multiple times when using .on() only

function changeStatus() { $('#dataTable tbody').on('change', '.orderStatus', function () {..code} } function showOrdersInModal() { $('#dataTable tbody').on('click', '.fa-eye-btn', function (e) ...
Shinxx's user avatar
  • 47
0 votes
1 answer
105 views

Passing custom data is different between focus and change event jQuery

I have a fiddle at https://jsfiddle.net/ws1hz5uf/ which demonstrates how to pass extra data to the target event. The first button (Go 1) trigger focus on the text input <div class="enclosing1&...
Sy Pham's user avatar
  • 99
0 votes
1 answer
62 views

How to dynamically set the event handler type?

I would like to dynamically set the event handler. Example: $('.test').on( 'click', function() { // My Code }); Expecting (pseudo) code: // .on or just on var eventHandler = ".on"; $('....
Slim's user avatar
  • 95
-1 votes
3 answers
286 views

JQuery clearing all text boxes

I have a question. I am trying to clear the text fields of a form once a button is clicked. This is the HTML for the input type: <input type="button" id="clear_entries" value=&...
javaperson's user avatar
0 votes
1 answer
119 views

Dynamically added element is forcing a reload

I have a table that has a range of elements inside of it. I have registered some event handlers and add these elements dynamically through injecting new html. Everything works for the original ...
Ben Muller's user avatar
0 votes
1 answer
43 views

jQuery / Javascript - function(event), (event => ), function() [duplicate]

I am new to javascript and jQuery and am trying to understand events better. Is there an ideal time to use function(event) {} vs. (event => {}? Can you do the same things with either and it's a ...
coder_person123's user avatar
0 votes
1 answer
29 views

How to get the class name with parent function in jquery

How can I get 'field_wrapper_1' class name while clicking the function addIncludeTextBox? <div class="field_wrapper_1"> <span class="error php-error" id="php-error_includes" style="...
Sandhya Latha B S's user avatar
0 votes
2 answers
1k views

Keyup Event Handler in dynamically added elements

"Total" input doesn't work in the added elements! It works only in the first row! Any help please? .........................................................................................................
Krityas's user avatar
  • 13
1 vote
2 answers
148 views

form submit event handler refreshes the page + jQuery

I made a template in index.html <div id="template" style="display: none;"> <form id="formSubmit"> <input type="hidden" id="price" /> <...
bbusdriver's user avatar
  • 1,617
1 vote
2 answers
1k views

Kendo ui - How to attach select event for kendo mvvm autocomplete field to the viewModel

Is there a straight-forward way to define a "select" event handler function within the mvvm html attributes for a kendo autocomplete field? For example, here is a working version of an autocomplete ...
GETools's user avatar
  • 43
0 votes
2 answers
228 views

jQuery click event fires on parent element multiple times

https://jsfiddle.net/50Lw423g/2/ gameLogic: function() { console.log("GAME LOGIC"); alert("Your Turn!"); var that = this; $(".game-screen").on("click", ".tic", function() { ...
Anon's user avatar
  • 109
1 vote
2 answers
180 views

How to add an EventListener that listens every click on window besides a specific element

I have a simple html file that has only one input field: <input value="Hello"> What I want is that the moment the user clicks on the input field, he/she will be able to edit the text, and ...
CrazySynthax's user avatar
  • 14.7k

15 30 50 per page