我正在尝试在 HTML 表中的 TR 中单击该元素。如果我单击 TR 内的 Select 输入,则CurrentTarget
字段返回“TR”,然后OriginalTarget
返回“SELECT”。
这是我的 HTML:
<table id="0" class="tableEdit">
<thead>
<tr>
<th name="id"></th>
<th name="name">Descripción Registro</th>
<th name="select">Fecha</th>
</tr>
</thead>
<tbody>
<tr>
<td>1651</td>
<td>Name</td>
<td>
<select name="selectName">
<option value="1">1</option>
<option value="2">2</option>
</select>
</td>
</tr>
</tbody>
</table>
这是我的代码:
//trb is each TR element of the line
$(trb).click(function(elem){
if (elem.currentTarget && elem.currentTarget.tagName.toLowerCase() === "tr" && !isInput(elem.originalTarget)){
if (editableRow){
var rowTrigger = editableRow.find("button").get();
$.editRow(rowTrigger,$.tableEditor.vault.getTableID($("#" + id)));
}
});
这段代码在我的网络浏览器上运行良好,但在移动设备上却不行,因为 OriginalTarget 返回undefined
. 有没有办法在移动网络浏览器上获取原始目标?