The following code returns ‘undefined’… $('select').change(function(){ alert($(this).data('id')); }); <select> <option data-id="1">one</option> <option data-id="2">two</option> <option data-id="3">three</option> </select> 9 Answers 9
This question already has answers here: Is there an “exists” function for jQuery? (46 answers) Closed 2 years ago. Yes, I know this ...
-
May 14, 2022
- 0 Comments
I’m creating a simple AJAX request which returns some data from a database. Here’s my function below: function AJAXrequest(url, postedData, callback) { $.ajax({ ...
-
May 14, 2022
- 0 Comments
Is it possible, using jQuery, to find out the type of an element with jQuery? For example, is the element a div, span, ...
-
May 14, 2022
- 0 Comments
To select a child node in jQuery one can use children() but also find(). For example: $(this).children('.foo'); gives the same result as: $(this).find('.foo'); ...
-
May 14, 2022
- 0 Comments
I’ve noticed that when using $.post() in jquery that the default contentType is application/x-www-form-urlencoded – when my asp.net mvc code needs to have ...
-
May 13, 2022
- 0 Comments
Problem: while developing using Electron, when you try to use any JS plugin that requires jQuery, the plugin doesn’t find jQuery, even if ...
-
May 12, 2022
- 0 Comments
In jQuery, if I have a reference to an element, how can I determine what kind of element it is, for example, an ...
-
May 12, 2022
- 0 Comments
In jQuery, $("...").get(3) returns the 3rd DOM element. What is the function to return the 3rd jQuery element? 11 Answers 11
I have a form with a standard reset button coded thusly: <input type="reset" class="button standard" value="Clear" /> Trouble is, said form is of ...
-
May 12, 2022
- 0 Comments