[转]JQuery简要介绍

今年准备给OEA支持B/S,所以学一下JQuery,如果你不是像我一个是一个新手的话,那么你可以直接略过本篇。

  • $('h1').html('hello world');
  • $('h1').css({ 'fontSize': '100px', 'color': 'red'}); // setting multiple properties
  • $('h1').height('50px');  // sets the height of all H1 elements
  • $('h1').height();        // gets the height of the first H1
  • $('a').attr({
       'title' : 'all titles are the same too!',
        'href' : 'somethingNew.html'
    });
  • $('h1').next('p');
  • $('div:visible').parent();
  • $('input[name=first_name]').closest('form');
  • $('#myList').children();
  • $('li.selected').siblings();
  • $('#myList li:first').clone().appendTo('#myList');
  • var $myNewElement = $('<p>New element</p>');
    $myNewElement.appendTo('#content');
  • $('h1').remove();
  • $('#myDiv').data('keyName', { foo : 'bar' });
    $('#myDiv').data('keyName'); // { foo : 'bar' }
  • $('p').click(function() {
       console.log('click');
    });
  • $('p').bind('click', function() {
       console.log('click');
    });
  • $('p').unbind('click');
  • $('h1').show();
  • $('h1').fadeOut('slow');  // using a built-in speed definition
  • $('h1').fadeIn(300);      // fade in over 300ms


转载于:https://www.cnblogs.com/h-hello/articles/1987008.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值