Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/91.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用JS高效地显示按钮上的文本_Javascript_Html_Css - Fatal编程技术网

Javascript 如何使用JS高效地显示按钮上的文本

Javascript 如何使用JS高效地显示按钮上的文本,javascript,html,css,Javascript,Html,Css,我想在单击按钮时显示一个div并隐藏其他按钮 以下是我的方法: var-enunt=document.querySelector(“.enunt”); var-rezolvare=document.querySelector(“.rezolvare”); var explicatie=document.querySelector(“.explicatie”); var complexitate=document.querySelector(“.complexitate”); var execu

我想在单击按钮时显示一个div并隐藏其他按钮

以下是我的方法:

var-enunt=document.querySelector(“.enunt”);
var-rezolvare=document.querySelector(“.rezolvare”);
var explicatie=document.querySelector(“.explicatie”);
var complexitate=document.querySelector(“.complexitate”);
var executie=document.querySelector(“.executie”);
var enuntText=document.querySelector(“.enunt problema”);
var-rezolvareText=document.querySelector(“.rezolvare problema”);
var explicateText=document.querySelector(“.explicatere problema”);
var complexitateText=document.querySelector(“.complexitate problema”);
var executieText=document.querySelector(“.executie problema”);
enunt.addEventListener(“单击”,函数(){
enuntText.style.display=“块”;
rezolvareText.style.display=“无”;
explicateText.style.display=“无”;
complexitateText.style.display=“无”;
executieText.style.display=“无”;
});
addEventListener(“单击”,函数(){
enuntText.style.display=“无”;
rezolvareText.style.display=“block”;
explicateText.style.display=“无”;
complexitateText.style.display=“无”;
executieText.style.display=“无”;
});
addEventListener(“单击”,函数(){
enuntText.style.display=“无”;
rezolvareText.style.display=“无”;
explicateText.style.display=“block”;
complexitateText.style.display=“无”;
executieText.style.display=“无”;
});
complexitate.addEventListener(“单击”,函数(){
enuntText.style.display=“无”;
rezolvareText.style.display=“无”;
explicateText.style.display=“无”;
complexitateText.style.display=“block”;
executieText.style.display=“无”;
});
addEventListener(“单击”,函数(){
enuntText.style.display=“无”;
rezolvareText.style.display=“无”;
explicateText.style.display=“无”;
complexitateText.style.display=“无”;
executieText.style.display=“block”;
});
html,body,div,span,applet,object,iframe,
h1、h2、h3、h4、h5、h6、p、块报价、预,
a、 缩写,首字母缩写,地址,大,引用,代码,
del、dfn、em、img、ins、kbd、q、s、samp、,
小、走向、强、次、辅助、tt、var、,
b、 u,i,中心,
dl,dt,dd,ol,ul,li,
字段集、表单、标签、图例、,
表格、标题、正文、tfoot、THAD、tr、th、td、,
文章、旁白、画布、细节、嵌入、,
图,figcaption,页脚,页眉,H组,
菜单、导航、输出、ruby、节、摘要、,
时间、标记、音频、视频、按钮{
保证金:0;
填充:0;
边界:0;
字体大小:100%;
字体:继承;
垂直对齐:基线;
}
/*旧浏览器的HTML5显示角色重置*/
文章,旁白,细节,图表,
页脚、页眉、H组、菜单、导航、节{
显示:块;
}
身体{
线高:1;
}
ol,ul{
列表样式:无;
}
区块报价,q{
报价:无;
}
blockquote:before,blockquote:after,
问:之前,问:之后{
内容:'';
内容:无;
}
桌子{
边界塌陷:塌陷;
边界间距:0;
}
html{
字体系列:“Proxima Nova”;
字号:200;
字体大小:10px;
最大高度:100%;
背景色:#00000 F;
}
身体{
宽度:100%;
颜色:#fff;
文本呈现:优化易读性;
字体系列:“Proxima Nova”!重要;
字体大小:10px;
溢出x:隐藏;
背景色:#00000 f!重要;
}
.导航栏海关{
位置:相对位置;
}
.abs-center-x{
位置:绝对位置;
左:50%;
转化:translateX(-50%);
}
.bg透明{
背景色:透明!重要;
}
.导航颜色{
颜色:#fff!重要;
字体大小:15px;
字体大小:粗体;
保证金:5px;
}
.导航颜色:悬停{
颜色:#77dff1!重要;
}
.导航激活{
颜色:#77dff1!重要;
}
.显示自定义{
文本转换:大写;
颜色:#77dff1;
字体大小:17.5rem!重要;
文本对齐:居中;
}
.铅海关{
字体大小:2.4rem;
文本对齐:居中;
保证金:0自动;
最大宽度:710像素;
线高:35px;
颜色:eeede7!重要;
}
/*连续中心*/
#中央的{
字体系列:“Proxima Nova”,无衬线;
显示:表格;
宽度:70%;
位置:绝对位置;
最高:50%;
左:50%;
转换:翻译(-50%,-50%);
}
#介绍包装{
显示:表格单元格;
垂直对齐:中间对齐;
最大宽度:710像素;
宽度:100%;
}
#介绍{
文本转换:大写;
颜色:#77dff1!重要;
字体大小:17.5rem;
文本对齐:居中;
}
.介绍{
字体大小:2.4rem;
文本对齐:居中;
保证金:0自动;
最大宽度:710像素;
线高:35px;
颜色:eeede7!重要;
}
#人力资源{
位置:绝对位置;
最高:90%;
宽度:100%;
保证金:0自动;
}
人力资源{
边框颜色:#77dff1!重要;
最大宽度:90%;
}
.纽扣包装{
职位:绝对职位;
文本对齐:居中;
保证金上限:2.5雷姆;
}
.按钮定制{
字体系列:“Proxima Nova”;
字号:600;
背景色:透明;
文本对齐:居中;
文字装饰:无;
字体大小:2.5rem;
颜色:#fff;
光标:指针;
边框:2px实心#77dff1;
填充:15px;
保证金:0自动;
}
.按钮自定义:悬停{
字号:100;
颜色:#00000华氏度;
背景#77dff1;
}
/*代伊问题*/
.列表项自定义{
文本对齐:居中;
边框:1px实心#77dff1;
颜色:#77dff1;
填充:2rem4rem;
边缘底部:0.7雷姆;
字体大小:粗体;
字体大小:1.25rem;
光标:指针;
}
.列表项自定义:悬停{
背景色:#77dff1;
颜色:#fff;
}
.col-sm-6{
文本对齐:居中;
边框:1px实心#77dff1;
颜色:#77dff1;
填充:2rem;
字体大小:粗体;
字体大小:1.25rem;
光标:指针;
}
.col hover:悬停{
字号:100;
颜色:#fff;
背景#77dff1;
}
上校:海关{
颜色:#fff;
文本对齐