Is it possible to view jQuery added data in Chrome

前端 未结 5 1923
青春惊慌失措
青春惊慌失措 2021-02-03 19:37

When creating websites I often use jQuery\'s .data() function to add data to elements.

Is it possible to view all data which is stored with an element in Ch

5条回答
  •  北恋
    北恋 (楼主)
    2021-02-03 20:15

    Open the inspector, and into the console, type

    $('').data()
    

    and then hit return to evaluate the data() method and show its return value directly.

    There's no need to use console.log unless you're calling it within non-interactive code.

提交回复
热议问题