如何使用开发者工具查看 jquery 的 data()?
How to see jquery's data() with developer tools?
我正在将数据分配给具有 data()
function 的元素。
如何在Chrome开发工具中查看调试正确性?
我没有看到任何 data-*
属性?
如果我有元素对象,我可以看到与 Watch
相关的数据。但是我可以看看是否有一些数据与 Elements
中的任何元素有关吗?
查看 documentation for the function you are using:
Using the data() method to update data does not affect attributes in the DOM. To set a data-* attribute value, use attr.
如果要读取数值,也需要用data()
读取。 jQuery 不会直接 将其与元素相关联。唯一的连接是在 jQuery 的内部存储中。
我正在将数据分配给具有 data()
function 的元素。
如何在Chrome开发工具中查看调试正确性?
我没有看到任何 data-*
属性?
如果我有元素对象,我可以看到与 Watch
相关的数据。但是我可以看看是否有一些数据与 Elements
中的任何元素有关吗?
查看 documentation for the function you are using:
Using the data() method to update data does not affect attributes in the DOM. To set a data-* attribute value, use attr.
如果要读取数值,也需要用data()
读取。 jQuery 不会直接 将其与元素相关联。唯一的连接是在 jQuery 的内部存储中。