JavaScript How to find an element regardless of its level?

this is similar to my last question. sorry I don't know whether i could edit the same question.

so here is my requirement. my HTML has the following part

<ul class="products-grid">
<li class="item">
    <div class="quickview-btn" data-pid="101" style="opacity: 0;">Quick View</div>
    <!-- some other elements -->
</li>
<li class="item">
    <div class="quickview-btn" data-pid="107" style="opacity: 0;">Quick View</div>
    <!-- some other elements -->
</li>
<li class="item">
    <div class="quickview-btn" data-pid="123" style="opacity: 0;">Quick View</div>
    <!-- some other elements -->
</li>
<li class="item">
    <div class="quickview-btn" data-pid="145" style="opacity: 0;">Quick View</div>
    <!-- some other elements -->
</li>

"I have n number of such unsorted lists"

when i click on one ".quickview-btn" div, i should get the "data-pid" value of next and previous (if exists) ".quickview-btn" divs, regardless, whetehr they are in next ul or previous ul.

note: I cannot modify the html structure as i do many other operations keeping this structure in mind. so I cannot put all the li's in a single ul.

I am clueless as i'm new to jQuery. can anyone please help me on this?

Answer:1

I have been trying to write a shared directive for my angular apps that turns an input field into jquery timepicker. I have two input fields, fromTime and toTime, and I want to update the toTime when ...

I have been trying to write a shared directive for my angular apps that turns an input field into jquery timepicker. I have two input fields, fromTime and toTime, and I want to update the toTime when ...

  1. angular directive data binding
  2. angular directive data
  3. angular directive data attribute
  4. angular directive data binding not working
  5. angular directive data change
  6. angular directive pass data
  7. angular directive async data
  8. angular directive get data attribute
  9. angular directive get data
  10. angular directive set data attribute
  11. angular directive send data to controller
  12. angular custom directive data binding
  13. angular update directive data
  14. angularjs data directive
  15. angular directive meta data
  16. angular directive wait for data
  17. angular directive loads before data
  18. angular directive with dynamic data
  19. angular refresh directive on data change
  20. angular directive wait for async data

This is the javascript for ajax html popup <script type="text/javascript"> $(document).ready(function() { $('.ajax-popup-link').magnificPopup({ type: 'ajax', overflowY: '...

This is the javascript for ajax html popup <script type="text/javascript"> $(document).ready(function() { $('.ajax-popup-link').magnificPopup({ type: 'ajax', overflowY: '...

  1. make function button excel
  2. make button function
  3. make button function as lever
  4. make button function javascript
  5. make button function in java
  6. how to make function button work
  7. how to make button function in android studio

I try to remove the duplicate value before storing it into a store. I want to store the same value in the store 1 time only. But it seems the following Ext.Array.unique line does not working. Could ...

I try to remove the duplicate value before storing it into a store. I want to store the same value in the store 1 time only. But it seems the following Ext.Array.unique line does not working. Could ...

  1. extjs remove duplicate records from store
  2. extjs remove duplicates from store
  3. extjs remove duplicates from array
  4. extjs remove duplicates
  5. extjs combobox remove duplicate

So I have a header.. and an image. On tablet I want to be able to pinch and zoom into the image but i'm struggling. I've looked at other similar questions. But as I'm still learning, i'm not fully ...

So I have a header.. and an image. On tablet I want to be able to pinch and zoom into the image but i'm struggling. I've looked at other similar questions. But as I'm still learning, i'm not fully ...

  1. pinch zoom using hammer.js
  2. hammer.js pinch zoom
  3. pinch zoom hammerjs