获取dom
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| $("domTagName"); $("#id"); $(".class"); $('div:odd').addClass(); $('div:even').addClass(); $(p:eq(1)).addClass(); $(document).ready(); children(); prepend() prependTo(); $('h2').clone().prependTo('p'); $.each(arr, function(index, value)){console.log(value)} $('dom').css('width','10px'); $('dom').toggleClass(className); remove() slideUp(spedd, callback)/slideDown(speed, callback); $('p').animate({'left':600}, time); animate(properites, speed, easing, callback);
|
正则:
1 2 3 4 5
| /\b\d{1,2}[\/-]\d{1,2}[\/-]\d{4}\b/ \b在正则表达式的开始和结尾,表示,单词边界,也就是说,单词必须与模式完全匹配。 \d{1,2} 意味着出现1到2位数字 [\/-]意味着出现/或- \d{4}出现4位数字
|
电子邮箱
1 2 3 4
| /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]+$) /^[\w-]+ 意味着字母数字下划线或连续字符。^表示开始。 $('select option:selected').val(); $('dom').hover(function())
|
文本css样式text-decoration:overline/underline/line-through