2.window
location.href
3.jquery
是原生js的封装库,可以简化js的操作
4.选择器
基本选择器
$(‘选择器’)
$('选择器:first')
$('选择器:last')
$('选择器:eq(index)')
$('选择器').eq(index)
$('选择器').children()
$('选择器').parent()
$('选择器').parents('选择器')
$('选择器').find('选择器')
$('选择器').prev()
$('选择器').next()
$('选择器').siblings()
5.元素操作
样式操作
$(’’).css(‘key’,‘value’);
$(’’).css({key:‘val’,key:‘val’});
属性操作
$('').attr('src','val');
$('').attr({key:'value'});
$('').removeAttr('key');
$('').prop('key');
文本操作
$('').html()
$('').text()
表单值
$('').val()
类名的操作
$('').addClass('类名')
$('').removeClass('类名')
6.相关的尺寸
$(’’).width();
$(’’).height();
$('').offset();
$('').scrollLeft()
$('').scrollTop()