就是 table 控制 一列 写什么
代码功能: 第一列写日期 第3列写个8
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript">
function getCurrentDate() {
var userAgent = navigator.userAgent.toLowerCase();
//判断是否为google的浏览器
var chrome = /chrome/.test(userAgent);
var currentDate = new Date();
// 因IE的年为2008和FF为108,判断
var currentYear = currentDate.getYear();
if ($.browser.mozilla || chrome) {
currentYear += 1900;
}
var currentDateStr = currentYear + '-' + (currentDate.getMonth() + 1) + '-'
+ currentDate.getDate();
return currentDateStr;
};
$(document).ready(function(){
$("#myTable tr td:nth-child(1)").each(function(){$(this).text(getCurrentDate());});
$("#myTable tr td:nth-child(3)").each(function(){$(this).text("8");});
});
</script>