Giter Club home page Giter Club logo

litejq's Introduction

liteJQ

一个仿jQuery的小工具库

学习《DOM启蒙》受到一些启发,一点点学习弄出来的东西。

由于使用了querySelector,所有只支持IE8+。
现在只有选择器和each(),text(),html(),append()四个方法,用法和jq类似。

使用示例:

$('a')                //选择所有a标签的dom节点
$('.head')            //选择所有head类的dom节点
$('#foot')            //选择所有id是foot的dom节点
$('<div>123</div>')   //如果输入的是带html标签的字符串,则会转换为dom返回

//遍历节点
$('a').each(function(){
	...
})

//text方法
$('a').text('abc')

//html方法
$('a').html('<div>a</div>')

//append方法
$('a').append('<div>a</div>')

注意:

扩展了全局String,添加了trim方法,用来去掉字符串左右两边的空白符。

litejq's People

Contributors

calimanco avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.