get(0).tagName获得作用标签示例代码

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

get(0).tagName获得作用标签示例代码

  2020-05-13 我要评论

复制代码 代码如下:

<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<https://img.qb5200.com/download-x/dd>
<dd>dddd<https://img.qb5200.com/download-x/dd>
<https://img.qb5200.com/download-x/dl>
</div>

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们