Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
Print all data attributes of a JQuery object

I am looking to print all data elements of a JQuery object. Here is my current code.

    cy.on('tap', 'node', function(evt){
      var clickedData = evt.target.attr("data");
      document.getElementById("nodeInfo").innerHTML = clickedData;
    });

Here is the evt.target in the console

Oe(1)
0: Oe [Oe(1), _private: {…}]
length: 1
_private:
active: false
animation: {current: Array(0), queue: Array(0)}
appliedInitStyle: true
arrowBounds: {source: null, target: null, mid-source: null, mid-target: null}
autoHeight: undefined
autoPadding: undefined
autoWidth: undefined
backgrounding: false
bbCache: {x1: 1090.4404404505497, y1: 155.49162695178342, x2: 1172.4404404505497, y2: 237.49162695178342, w: 82, …}
bbCachePosKey: 0
bbCacheShift: {x: 0, y: 0}
bodyBounds: {x1: 1090.4404404505497, y1: 155.49162695178342, x2: 1172.4404404505497, y2: 237.49162695178342, w: 82, …}
children: []
classes: Set(0) {size: 0}
compoundBoundsClean: false
cy: Za {_private: {…}}
data:
id: "0000_86a2e18d-ea5f-44f3-94a3-aa5cf72f8652_20211010-224514"
name: "Ryan"
type: "somnas:Person"
[[Prototype]]: Object
edges: [Oe(1)]
emitter: Ni {qualifierCompare: ƒ, eventMatches: ƒ, addEventFields: ƒ, callbackContext: ƒ, beforeEmit: ƒ, …}
grabbable: true
grabbed: false
group: "nodes"
hasPie: false
labelBounds: {all: {…}, source: null, target: null, main: {…}, sourceRot: null, …}
labelDimsKey: 1274045721130407
labelKey: -1742728187463711
labelStyleKey: 2774432038878951
listeners: []

You can see the data element I want printed.

Expected: id: xxx name: xxx type: xxx

Result: undefined

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda