-
jquery获取标签名称: prop('tagName')
- 在当前的jQuery版本中,prop可以获得,但是attr获得不到
- >$("#jump-to-nav").prop("tagName")
- "DIV"
- $("#jump-to-nav").attr("tagIndex")
- undefined
- 如果prop获取不到也是underfined
- 获得的标签名看起来都是大写的
- 在Chrome里似乎也可以看到它的存在-DOM信息里面
-
ATTRIBUTE/PROPERTY .ATTR() .PROP()
accesskey ✓
align ✓
async ✓ ✓
autofocus ✓ ✓
checked ✓ ✓
class ✓
contenteditable ✓
defaultValue ✓
draggable ✓
href ✓
id ✓
label ✓
location * ✓ ✓
multiple ✓ ✓
nodeName ✓
nodeType ✓
readOnly ✓ ✓
rel ✓
selected ✓ ✓
selectedIndex ✓
src ✓
style ✓
tabindex ✓
tagName ✓
title ✓
type ✓
width ** ✓
-
-
转自:http://see.sl088.com/wiki/JQuery_%E8%8E%B7%E5%BE%97%E6%A0%87%E7%AD%BE%E7%B1%BB%E5%9E%8B