1,換行 <br>
2,html圖像通過標簽<img>來定義 <img src="../a.jpg" width="20" height="20">
3,class為html 元素定義一個或者多個類名 (className) js獲取 class值方式為 $(".className").val();? id獲取值的方式為$("#id").val(); name獲取值的方式為:
var name=$.trim($('[name="pageSize"]').val());
4翩剪, Style 定義元素的行內(nèi)樣式
5, ? Title 描述了元素的額外信息
6喳资, 使用data-*屬性來鑲嵌自定義數(shù)據(jù)? ?獲取data屬性的值 data-id? data-name………..等等data類型的都可以這樣獲取值?
7檀头, <ul>
? ? <li onclick="showDetails(this)" id="owl" data-id="bird">Owl</li>
</ul>
//獲取data的值
?function showDetails(o){
? ? ? ? ? ? ? ?var animaltype =$(o).data('id');
? ? ? ? ? ? ? ? alert(animaltype);
? ? ? ? ? ? ? ? ? }
8,設(shè)置自動播放video元素 ,這樣可以避免播放不兼容的問題 且值播放一次
<video contorls autoplay loop>
<source src="movie.mp4" type="video/mp4">
<source src="movie.org" type="video/ogg">
</video>
9坎怪, 文本框? <textarea rows=”10” cols=”50”>
10,加粗文本? ?<strong>加粗文本進行格式化</strong>
11罢坝,循環(huán)數(shù)組
success: function(response){
console.log(response);
var data =response.data;
$(response.data).each(function(ix ,item){
layer.alert(item.awid);
});
}
12,頁面刷新代碼 window.location.reload();
13,在頁面debugger方法-------------在方法里直接寫debugger就可以
14 checkbox選中事件, $(this).val()
<dd>
<label class="">
? ? ? <input type="checkbox" value="5" name="checkbox" id="termmore_add_right">
? ? ? 添加</label>
? ?<label class="">
? <input type="checkbox" value="6" name="checkbox" id="termmore_update_right">
? ? ? 修改</label>
? ?<label class="">
? ? ? <input type="checkbox" value="7" name="checkbox" id="termmore_delete_right">
? ? ? 刪除</label>
? ?<input type="checkbox" value="8" name="checkbox" id="termmore_query_right">
? ? ? 查看</label>
</dd>
var list=nea Array();
$.each($('input:checkbox"checked"),function(){
list.push($(this).val());
});
15 如果頁面?zhèn)鬟f值可能為空的時候,后臺不用int接收 搅窿,用Integer接收
16嘁酿,跳轉(zhuǎn)到父一級頁面的方法?
top.location.href="index.html"
17,多個三目表達式的用法
<th data-name='finame'>${flname==1?"工資支出":flname==2?"服裝收入":flname==3?"吃飯支出" :flname==4?"禮金支出":flname==5?"交通支出":flname==6?"股票收入":"其他支出"? }</td>
18,?http://www.jq22.com/jquery-info18715 自動彈窗
https://www.jquery123.com/category/manipulation/dom-replacement/