作为一个新手,我郑重的告诫学到这会儿的,都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评论!!!!!!!!!!!!!!!!!!!都不要看评
2016-08-17
最新回答 / 嚯霍嚯
document.getElementsByTagName("div")[0].removeAttribute("style");//定义"取消设置"的函数
2016-08-17
function changeCf(){
if(confirm("是否取消设置回复默认?")){
text=document.getElementById("txt");
text.setAttribute('style','');
}
else{
return false;//定义"取消设置"的函数
}
if(confirm("是否取消设置回复默认?")){
text=document.getElementById("txt");
text.setAttribute('style','');
}
else{
return false;//定义"取消设置"的函数
}
var text=document.getElementById("txt");//定义"隐藏内容"的函数
function changeDn(){
text.style.display="none";
}
var text=document.getElementById("txt");//定义"显示内容"的函数
function changeDb(){
text.style.display="block";
}
function changeDn(){
text.style.display="none";
}
var text=document.getElementById("txt");//定义"显示内容"的函数
function changeDb(){
text.style.display="block";
}
var text=document.getElementById("txt");//定义"改变宽高"的函数
function changeWh(){
text.style.width="300px";
text.style.height="500px";
}
function changeWh(){
text.style.width="300px";
text.style.height="500px";
}
<script type="text/javascript">
var text=document.getElementById("txt");//定义"改变颜色"的函数
function changeColor(){
text.style.color="red";
text.style.backgroundColor="blue";
}
var text=document.getElementById("txt");//定义"改变颜色"的函数
function changeColor(){
text.style.color="red";
text.style.backgroundColor="blue";
}
已采纳回答 / weibo_好好死一回_0
<...code...>不知道你的具体问题何在,以上是我编写的代码,能出效果。p1.className="one";这一句就是给id="p1"的元素添加"类名为one"的样式。如有疑问,欢迎追问
2016-08-17
已采纳回答 / 慕粉3585893
因为document.getElementById("con");此时它只是获得了id为con的对象,并不是它的内容。所以输出结果是那样的,意思是这是一个段落对象。
2016-08-17
con.style.cssText='color:red;background:#ccc;width:300px';
2016-08-17
function rec(){
var score;
score = prompt("考多少分?");
if(score>=90)
{
document.write("上来就是一个么么哒!");
}
else if(score>=75)
{
document.write("这个月加下月0花钱");
}
else if(score>=60)
{
document.write("还知道回家?!");
}
else
{
document.write("爸妈把藏多年秘密和你说,你是捡来的!");
}
}
var score;
score = prompt("考多少分?");
if(score>=90)
{
document.write("上来就是一个么么哒!");
}
else if(score>=75)
{
document.write("这个月加下月0花钱");
}
else if(score>=60)
{
document.write("还知道回家?!");
}
else
{
document.write("爸妈把藏多年秘密和你说,你是捡来的!");
}
}
2016-08-17
function rec(){
var mymessage= confirm("是女士吗?") ;
if(mymessage==true)
{
document.write("来这里学习的都是女神!");
}
else
{
document.write("男屌丝来这里学习有前途!");
}
}
</script>
var mymessage= confirm("是女士吗?") ;
if(mymessage==true)
{
document.write("来这里学习的都是女神!");
}
else
{
document.write("男屌丝来这里学习有前途!");
}
}
</script>
2016-08-17
var mychay="在座的各位"
var mystr = "都是";
var mychar = "大神!";
document.write(mystr+mychar+chay);
var mystr = "都是";
var mychar = "大神!";
document.write(mystr+mychar+chay);
2016-08-17
<script type="text/javascript";
function hidetext(){
var mychar=document.getElementById("con");
mychar.style.display="none";
}
function showttext(){
var mychar=document.getElementById("con");
mychar.style.display="block";
}
</script>
function hidetext(){
var mychar=document.getElementById("con");
mychar.style.display="none";
}
function showttext(){
var mychar=document.getElementById("con");
mychar.style.display="block";
}
</script>
2016-08-17
function c(){
var nji=document.getElementById("txt")
txt.style.display="none";
}
//定义"显示内容"的函数
function d(){
var kok=document.getElementById("txt")
txt.style.display="block";
}
//定义"取消设置"的函数
function e(){
var bbh=confirm()
if(bbh="true")
txt.removeAttribute("style");}
var nji=document.getElementById("txt")
txt.style.display="none";
}
//定义"显示内容"的函数
function d(){
var kok=document.getElementById("txt")
txt.style.display="block";
}
//定义"取消设置"的函数
function e(){
var bbh=confirm()
if(bbh="true")
txt.removeAttribute("style");}
<script type="text/javascript">
var mychar=document.getElementById('con');
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML = "Hello world!";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
</script>
var mychar=document.getElementById('con');
document.write("原标题:"+mychar.innerHTML+"<br>"); //输出原h2标签内容
mychar.innerHTML = "Hello world!";
document.write("修改后的标题:"+mychar.innerHTML); //输出修改后h2标签内容
</script>
2016-08-17