get(0).tagName获得作用标签示例代码
更新时间:2014年10月08日 17:33:34 投稿:whsnow
get(0).tagName可获得作用标签,下面是它的一个小应用,在学习js的朋友可以参考下
复制代码 代码如下:
<script type="text/javascript" src="jquery1.4.js"></script>
<script type="text/javascript">
$(function(){
$(".test li,.test dd").click(function(){
alert('本身为大写:' + $(this).get(0).tagName + '\n利用toLowerCase()转换为小写:' + $(this).get(0).tagName.toLowerCase() + '\n利用toUpperCase()转换为大写:' + $(this).get(0).tagName.toUpperCase());
})
});
</script>
<div class="test">
<ul>
<li>lili</li>
<li>lili</li>
</ul>
<dl>
<dd>dddd</dd>
<dd>dddd</dd>
</dl>
</div>
相关文章
Locate a File Using a File Open Dialog Box
Locate a File Using a File Open Dialog Box...2007-06-06jQuery ajax(复习)—Baidu ajax request分离版
你没有看错标题,本文的确是在讲Baidu ajax,不过是很久很久以前的版本了,我们先分析一段简单的ajax代码,来自早期的百度七巧板项目通过这个来先复习一遍ajax的知识2013-01-01
最新评论