代码
/**
* 增加自定义时间
**/
function addTimeSet(hour, minute) {
var tab = document.getElementById("customTimeTab");
var curRowLength = $("#customTimeTab").find("tr").length;
if ( curRowLength > 10) {
alert("下发时间点最多只有10个");
return;
}
if (hour == null) {
hour = "";
}
if (minute == null) {
minute = "";
}
var trBegin = '<tr>';
if(curRowLength % 2 == 1) {
trBegin = '<tr class="even">';
}
var indexNum = curRowLength + "、";
var tdInnerHTML = '<input name="1first" type="text" value="' + hour + '" size="2" maxlength="2">:<input '
+ 'name="1sec" type="text" value="' + minute + '" size="2" maxlength="2"> <font '
+ 'color="#FF0000">*</font>(时间格式 hh:mm)';
var tdDelHTML = '<input type="button" name="del1" value=" 删除 " class="button_80" onMouseOver="this.className=\'button_80_over\'"'
+ 'onMouseOut="this.className=\'button_80\'" onclick="deleteTimeSet(this)">';
var oneRowHtml = trBegin + '<td align="center">'+indexNum+'</td><td>'+tdInnerHTML+'</td><td>'+tdDelHTML+'</td></tr>';
$("#customTimeTab").append(oneRowHtml);
}
/**
* 删除自定义时间
**/
function deleteTimeSet(node) {
var curNode = node.parentNode.parentNode;
$(curNode).remove();
}
* 增加自定义时间
**/
function addTimeSet(hour, minute) {
var tab = document.getElementById("customTimeTab");
var curRowLength = $("#customTimeTab").find("tr").length;
if ( curRowLength > 10) {
alert("下发时间点最多只有10个");
return;
}
if (hour == null) {
hour = "";
}
if (minute == null) {
minute = "";
}
var trBegin = '<tr>';
if(curRowLength % 2 == 1) {
trBegin = '<tr class="even">';
}
var indexNum = curRowLength + "、";
var tdInnerHTML = '<input name="1first" type="text" value="' + hour + '" size="2" maxlength="2">:<input '
+ 'name="1sec" type="text" value="' + minute + '" size="2" maxlength="2"> <font '
+ 'color="#FF0000">*</font>(时间格式 hh:mm)';
var tdDelHTML = '<input type="button" name="del1" value=" 删除 " class="button_80" onMouseOver="this.className=\'button_80_over\'"'
+ 'onMouseOut="this.className=\'button_80\'" onclick="deleteTimeSet(this)">';
var oneRowHtml = trBegin + '<td align="center">'+indexNum+'</td><td>'+tdInnerHTML+'</td><td>'+tdDelHTML+'</td></tr>';
$("#customTimeTab").append(oneRowHtml);
}
/**
* 删除自定义时间
**/
function deleteTimeSet(node) {
var curNode = node.parentNode.parentNode;
$(curNode).remove();
}