获取同级 HTML 元素的标签?(jQuery)
Get the Tag of the sibling HTML element? (jQuery)
目前,我有以下内容:
if ($(this).next().attr("tagName") == "INPUT") {
increment += 20;
}
我正在使用 EXT.NET 它形成元素的方式真的很古怪。无论如何,我需要的是找到HTML中下一个元素的标签。里面的代码看起来像这样:
<div class="x-form-field-wrap x-form-field-trigger-wrap" id="ext-gen80" style="width: 167px; ">
<input type="hidden" name="ctl00_MainContent_Department_Value" id="ext-gen82" value="" style="border-bottom-width: 2px; border-bottom-color: rgb(87, 196, 255); ">
<input type="text" size="24" autocomplete="off" id="ctl00_MainContent_Department" name="ctl00_MainContent_Department" class="x-form-text x-form-field" style="width: 142px; border-bottom-width: 2px; border-bottom-color: rgb(252, 164, 76); ">
<img src="data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" class="x-form-trigger x-form-arrow-trigger" id="ext-gen81" style="">
<input type="hidden" size="20" autocomplete="off" id="ctl00_MainContent_Department_SelIndex" name="ctl00_MainContent_Department_SelIndex" class=" x-form-hidden x-form-field" style="border-bottom-width: 2px; border-bottom-color: rgb(87, 196, 255); "></div>
当我尝试使用alert($(this).next().attr("tagName"))时;它返回"unidentity"
从jQuery 1.6开始使用.prop("tagName");
。
相关文章:
- Jquery标签插件粘贴问题
- 谷歌地图jquery标签未加载
- 选择带有 jQuery 标签的“li”项时出错
- 莫里斯.js甜甜圈标签不在中间的jquery标签中
- 花哨的jQuery标签选择器
- 为什么这个网站返回包装在jQuery标签中的自动完成数据
- Jquery标签删除导致换行
- jQuery标签-它,如何执行post时,项目删除
- jQuery标签“未定义不是一个函数”
- 修改jQuery标签插件,在加载时显示特定的标签[includes JSFiddle]
- 使用jQuery标签和滑动图像库(simplyScroll)
- 如何在加载新页面时启用jquery标签/单选按钮
- 未捕获的ReferenceError: $没有为jQuery标签定义
- jQuery标签在另一个jQuery标签- OnActivate事件
- 自动显示标签内容的页面加载- jQuery标签
- JQuery标签:如何显示'Loading. '消息# 39;等待AJAX HTTP请求响应
- 我的jquery标签代码有什么问题?
- URL阻止功能中的Jquery标签
- Jquery标签添加删除
- jQuery标签'for'属性选择器