81,092
社区成员
发帖
与我相关
我的任务
分享
<input name="button" type="button" class="Submit" style="width:100px" value="新增角色" onclick="showAddRole();" />
忘了 还有弹出的按钮<!-- 新增弹框 -->
<div id="addRole" style="display: none; width: 100%; height: 100%; background-color: #000; position: absolute; top: 0; left: 0; z-index: 2; opacity: 0.15; filter: alpha(opacity = 15);"></div>
<div id="addRoleChildDivId" class="wh600 wrap_popboxesok4" style="display: none; position: fixed; width: 240px; height:170px; top: 100px; left: 50%; margin-left: -150px; z-index: 3; font-size: 12px; font-family: '宋体';">
<div id="popDiv" style="background:#FFFFFF;width:280px">
<table style="width: 100%">
<tr style="background:#C8DEE9;" >
<th colspan="2"><span style='color: #000000'>新增角色</span></th>
</tr>
<tr>
<td style="width:60px">角色名 :</td>
<td><input type="text" id="roleNameAdd" style="width: 95%;border: 1px solid;" /></td>
</tr>
<tr align="center">
<td colspan="2">
<input class="Submit" type="button" value="提交" style="width: 60px" onclick="addRole()"/>
<input class="Submit" type="reset" value="取消" onclick="hideAddRole()" style="width: 60px"/ />
</td>
</tr>
</table>
</div>
</div>
js代码
<script type="text/javascript" language="JavaScript">
//新增角色弹框显示
function showAddRole() {
var div1 = document.getElementById("addRole");
var div2 = document.getElementById("addRoleChildDivId");
div1.style.display="";
div2.style.display="";
}
//新增角色弹框隐藏
function hideAddRole() {
var div1 = document.getElementById("addRole");
var div2 = document.getElementById("addRoleChildDivId");
div1.style.display="none";
div2.style.display="none";
//设置输入框文本为空
document.getElementById('roleNameAdd').value="";
}
</script>