1个回答
展开全部
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
form{
marign:0px auto;
padding:0;
width:500px;
}
input[type='text']{
background-color:black;
color:white;
border:2px solid gray;
width:400px;
height:30px;
margin:0px 0px 10px 0px;
}
textarea{
background-color:black;
color:white;
border:2px solid gray;
resize:none;
width:400px;
height:200px;
}
.btndiv{
text-align:right;
width:406px;
}
.btndiv>button{
width:80px;
height:33px;
margin:5px 0px 0px 0px;
}
</style>
<title>RunJS 演示代码</title>
<script>
var mt = function(){
var receiver = sjr.value;
var subject = zt.value;
var body = nr.value;
var url = "mailto:" + receiver + "?subject=" + subject + "&body=" + body;
ss.setAttribute("href", url);
ss.click();
}
</script>
</head>
<body>
<div>
<input type="text" placeholder="收件人" id="sjr" />
<input type="text" placeholder="主题" id="zt" />
<textarea placeholder="内容" id="nr"></textarea>
<div class="btndiv">
<a href="" style="display:none;" id="ss"></a>
<button onclick="mt()">
发送
</button>
</div>
</div>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询