Accordion inside Dropdown without jQuery?

I want to have an accordion inside my dropdown menu. However, when clicking on the accordion to open/close it, the entire dropdown collapses. Instead, I want the dropdown to remain open and the accordion to open/close freely. Check out a demo here <div class=”btn-group dropdown”> <button class=”btn btn-secondary dropdown-toggle” type=”button” id=”dropdownMenu2″ data-toggle=”dropdown”> Dropdown </button> <div…

jquery “this” selector replacement in React.JS

I am converting some jQuery code to React.JS, but got stuck due to jQuery “this” selector. $(‘.nav-cart-options-toggle’).on(‘click’, function() { $(this).toggleClass(‘show’); $(this) .closest(‘.nav-cart-options’) .find(‘ul’) .toggle(); }); I was able to do the toggling using React, but it is toggling all the options on individual click like this: But I need toggling for each drop downs like…

kinds of response in fetch wich support jquery and html

im loading a page (wich has html and jquery in it) by using fetch. but it dosent response my jquery codes. fetch(‘/get_insurance.bc’, { method: ‘POST’, body: ‘inscountry=[##cms.form.inscountry##]&fdate=[##cms.form.fdate##]-05&tdate=[##cms.form.tdate##]&birthdate=’+brt+’&userid=[##userid.userid.userid##]’}) .then(response => response.text()) .then(html => { document.getElementById(‘ins-list-resize’).innerHTML = html; })

Image didn’t change in jQuery setAttribute

i’m trying to change images based on the user pressing the next button but that isn’t happening var my_image = document.getElementById(main_image); var image_array = [“https://www.w3schools.com/jsref/klematis2.jpg”]; var image_index = 1; function change_image(){ my_image.setAttribute(“src”, image_array[image_index]); image_index++; if(image_index > 1){image_index = 0;} } <img src=”https://www.w3schools.com/jsref/klematis.jpg” id =”main_image”> <button onclick=”change_image()”> next </button>

jQuery closest() and/or find() not working dynamic datatable

I am having the idea that closest() and find() are not working on a dynamic datatable. I am trying to get the ID in the first <td> element in the same row, but it keeps getting back empty. var idOfTheProperty = $(this).closest(‘tr’).find(‘td:first’).text(); <tr> <td><span>999</span</td> <td>somewhere.com/idOfTheProperty</td> <tr> The datatable is made in here: <div class=”kt-datatable” id=”json_data”></div>…