Javascript 显示属性';标题';聚焦或单击其他元素中的元素数量
在焦点上或单击其他元素(例如标签)中显示元素的属性“标题”(输入类型文本,选择并选中复选框)。 请Javascript 显示属性';标题';聚焦或单击其他元素中的元素数量,javascript,jquery,user-experience,Javascript,Jquery,User Experience,在焦点上或单击其他元素(例如标签)中显示元素的属性“标题”(输入类型文本,选择并选中复选框)。 请 谢谢可能的解决方案之一: html: 男性 女性 那看起来像是练习……你累了什么?我不太喜欢编码。无论如何,我尝试了模糊,但它只适用于输入类型的文本。 $(document).on('mouseenter', 'input,select', function (e) { $('#current-control-label').text($(this).data().title); });
谢谢可能的解决方案之一: html:
男性
女性
那看起来像是练习……你累了什么?我不太喜欢编码。无论如何,我尝试了模糊,但它只适用于输入类型的文本。
$(document).on('mouseenter', 'input,select', function (e) {
$('#current-control-label').text($(this).data().title);
});
$(document).on('mouseleave', 'input,select', function (e) {
$('#current-control-label').text(' ');
});
<table>
<tr>
<td><input type="text" data-title="Name" /></td>
<td>
<select data-title="Gender">
<option value="M">Male</option>
<option value="M">Female</option>
</select>
</td>
<td><input type="radio" data-title="Active" /></td>
</tr>
<tr>
<td colspan="2">
<span id="current-control-label"> </span>
</td>
</tr>
</table>