這算是一點小積累吧:
1、js中對按鈕進行置灰和恢復
//按鈕置灰不可用 $("#download").attr('disabled',true);//jquery寫法,設置按鈕不可用 document.getElementById("download").setAttribute("disabled", true);//原生js寫法,設置按鈕不可用 document.getElementById("download").style.backgroundColor = 'silver';//設置背景色為灰色 //按鈕恢復使用,並設置了背景色 document.getElementById("download").removeAttribute("disabled"); document.getElementById("download").style.backgroundColor = '#428BCA';//設置背景色
'silver' 的顏色為:
'#428BCA'的顏色為:
2、js里面對jsp某個input域賦值(根據 id和name都是該種形式,只需要把id換成name)
(1)input域顯示:
ocument.getElementById('countSize').value = Data['countSize'];//原生js顯示
$.input("[id='countsize']").val(Data['countSize']);//jquery顯示
(2)顯示一個html
document.getElementById("Btn").innerHTML ="html里面的內容"//原生html顯示
$(#顯示區域的id).html("html里面的內容");//jquery顯示
(3)取input域的值
var countSize = document.getElementById('countSize').val();//原生js取值
var countSize = $.input("[id='countSize']").val();//jquery取值
下班啦!!!!