Hello! There is such a line on the site: enter image description here Can you please tell me how to get and write z-index to a variable via data-id, otherwise there are a lot of such lines?

  • 2
    it's very simple: take it and get it) - ThisMan
  • @ThisMan is logical .. :) I hate such questions. - Excess Gophers
  • I will be grateful if you write how to take and get)) - Ivan

1 answer 1

Option with jQuery:

$('*[data-id="12"]').css('z-index'); 

Without:

 document.querySelector('[data-id="12"]').style.zIndex 
  • Thank you very much)) - Ivan