jquery - 使用 jquery 从数据集中获取值
问题描述
当我控制台事件的值以这种类型显示数据时,我正在使用可放置事件:-
console.log('event-d--', event.target.childNodes[4]);
this is result
dataset:DOMStringMap {sectionvalue: "599a974a7c086869cba64435"}
但是当我得到数据时,这里显示未定义的是我的代码:-
console.log('event-d--', event.target.childNodes[4].dataset["sectionValue"]);
它显示未定义,我也试过这个: -
console.log('event-d--', event.target.childNodes[4].dataset["sectionvalue"]);
console.log('event-d--', event.target.childNodes[4].dataset.sectionvalue);
但没有运气,这是我的 HTML 代码:-
<td *ngFor="let doctor of calendarUsers" style="width:10%; border-right: 1px solid #eee;">
<ul id="{{doctor.id}}" class="connectedSortable">
<li *ngFor="let calendarAppointment of calendarAppointments | filterBy: {resourceId : doctor.id}" class="ui-state-default"
attr.data-sectionvalue="{{doctor.id}}" ></li>
</ul>
</td>
解决方案
推荐阅读
- xml - XML 'name' 属性和带有 SelectNodes 的 XML 变量类型
- python - 如何从mysql表中只显示输入的生日名称
- angular - 带有茉莉花弹珠的 Ngrx 测试选择器:预期 $.length = 1 到等于 2
- mapping - 处理映射中名称相同但表不同的字段
- angular - 基于Angular 6中选中的复选框调用两种不同方法的一个按钮
- macos - 我的堆栈程序的第一个变量是什么?
- javascript - JavaScript 中的 @Contains 等价物是什么?
- sql-server - 交叉应用 - 查找最新更改
- reactjs - Redux thunk - 异步操作范围更改
- python-3.x - 如何在不使用字符串的情况下检查回文数?