jquery-总结

2016-06-10  本文已影响20人  stone_yao

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" );
上一篇 下一篇

猜你喜欢

热点阅读