convert $(".collapse.show .nav-link:contains('wings')").click(); to vanilajs in javascript

To convert the jQuery selector to plain JavaScript, we can use the querySelector method to select the element and add an event listener to it. Here's an example:

index.tsx
const link = document.querySelector('.collapse.show .nav-link:contains("wings")');
link.addEventListener('click', function() {
  // Your code here
});
151 chars
5 lines

In the code above, we first select the link element using querySelector. We then add an event listener to it, which fires when the link is clicked. Inside the event listener, you can put the code that you want to execute when the link is clicked.

gistlibby LogSnag