<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<div>1</div>
<div>2</div>
<p>3</p>
<span id="spa">4</span>
</body>
<script type="text/javascript">
(function(global){
function jquery(selectors){
return new jquery.fn.init(selectors);
}
jquery.fn=jquery.prototype={
constructor:jquery,
init:function(selectors){
var elements=document.querySelectorAll(selectors);
for(var i=0;i<elements.length;i++){
this[i]=elements[i];
}
this.length=elements.length;
},
css:function(name,value){
for(var i=0;i<this.length;i++){
this[i].style[name]=value;
}
}
}
jquery.fn.init.prototype=jquery.fn;
window.$=window.jquery=jquery;
})(window)
$('div').css('color','red');
$('#spa').css('color','yellow')
</script>
</html>