Search results
26 lut 2009 · You can take all your "selected values" by the name of the checkboxes and present them in a sting separated by ",". A nice way to do this is to use jQuery's $.map(): var selected_val = $.map($("input[name='d_name']:checked"), function(a) { return a.value; }).join(','); alert(selected_val);
18 gru 2008 · What you are doing is iterating through all the trs in the table, finding the first td in the current tr in the loop, and extracting its inner html. To select a particular cell, you can reference them with an index: $('#mytable tr').each(function() {. var customerId = $(this).find("td").eq(2).html(); });
24 kwi 2024 · This post will discuss how to get all options of a select in JavaScript and jQuery. 1. Using jQuery. With jQuery, you can use the .each() method, which is a concise and less error-prone way to iterate over the DOM elements.
26 kwi 2024 · One could use document.querySelectorAll() to get all the elements, put them into an array using the spread syntax ... and then call .map() to put the innerText of each element into an array. function tableToEmail() { const emails = document.querySelectorAll('td:has(input.selector:checked) ~ .email'); const recipients = [...emails].map(el => el ...
24 mar 2023 · The .val() function in JQuery can be used to get the value of the selected options in a select element. Here is the code: var selectedValues = $('#mySelect').val();
1 maj 2021 · This post will discuss how to get all selected values of a multi-select dropdown list with jQuery. With jQuery, you can use the .val() method to get an array of the selected values on a multi-select dropdown list.
There are two ways to programmatically access the current selection data: using .select2('data'), or by using a jQuery selector. Using the data method. Calling select2('data') will return a JavaScript array of objects representing the current selection.