mui选择器和dom获取元素的区别(记得把mui对象转为dom对象才能调用用dom方法)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="js/mui.min.js"></script>
<link href="css/mui.min.css" rel="stylesheet" />
</head>
<body>
<div id="div1">div1</div>
<div id="div">div2</div>
<div id="div2" class="nw1">div3</div>
<input type="button" name="text" id="" value="666" />
<script src="js/mui.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
console.log(mui('div')[0].innerHTML);//mui做dom操作必须先加【0】转为dom元素
console.log(mui('input')[0].value);//mui括号里的可以是id、标签、class属性
//getart
var lui=mui('input')[0];//mui方式获取input对象
console.log(lui.attributes.type.nodeValue);//获取input标签的type属性值
console.log(lui.attributes['name'].nodeValue);//另一种获取input标签的name属性值
console.log(document.getElementById('div').innerHTML);//这里是js的方法
var nw=document.getElementById('div2');
nw.setAttribute('demo','demo1');//设置自定义属性和值
console.log(nw.attributes['demo'].nodeValue);
var nw1=document.getElementsByClassName('nw1')[0].innerHTML;
console.log(nw1);
(function($){//这里是在闭包里使用mui获取元素
console.log($('div')[0].innerHTML);
})(mui);
</script>
</body>