美文网首页
jquery-总结

jquery-总结

作者: stone_yao | 来源:发表于2016-06-10 13:39 被阅读20次

write less ,do more-------http://api.jquery.com

1.If no elements match the provided selector, the new jQuery object is "empty"; that is, it contains no elements and has .length property of 0.

2.jQuery( html, attributes ),to create html element with its attr and event

$( "<div/>", {
  "class": "test",
  text: "Click me!",
  click: function() {
    $( this ).toggleClass( "test" );
  },
  on{
    touchstart: function( event ) {
      // Do something
    }
  }
})
  .appendTo( "body" );

相关文章

网友评论

      本文标题:jquery-总结

      本文链接:https://www.haomeiwen.com/subject/gassdttx.html