当前位置: 移动技术网 > IT编程>开发语言>JavaScript > jQuery取得元素标签名称小结(附代码)

jQuery取得元素标签名称小结(附代码)

2017年12月12日  | 移动技术网IT编程  | 我要评论

代码如下:

<%@ page language="java" contenttype="text/html; charset=utf-8"
  pageencoding="utf-8"%>
<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>insert title here</title>
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/1.12.2/jquery.slim.min.js"></script>
</head>
<body>
<img id="myimg" style="width: 120px;height: 120px;" alt="" src="123.jpg">

<script type="text/javascript">
console.log($('#myimg').prop('nodename'));
</script>
</body>
</html>

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助~如果有疑问大家可以留言交流,谢谢大家对移动技术网的支持!

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网