gpt4 book ai didi

javascript - Jquery 改变类的所有边界

转载 作者:太空宇宙 更新时间:2023-11-03 22:55:48 26 4
gpt4 key购买 nike

为什么 $( "demo").css("border", "1px solid #FFF"); 不工作?该功能的每个其他部分都在工作,但不是那个。 “demo”类是“page1.html”中的常规类。

<script>
var button = 0;
var activecolor = 0;
function pressbutton(a){
button = a;
var color1 = "#46B29D";
var color2 = "#F0CA4D";
var color3 = "#E37B40";
if (button === 1) {
activecolor = color1;
document.getElementById("button1").className = "activemenubutton";
document.getElementById("button2").className = "menubutton";
document.getElementById("button3").className = "menubutton";
} else if (button === 2){
activecolor = color2;
document.getElementById("button1").className = "menubutton";
document.getElementById("button2").className = "activemenubutton";
document.getElementById("button3").className = "menubutton";
} else if (button === 3){
activecolor = color3;
document.getElementById("button1").className = "menubutton";
document.getElementById("button2").className = "menubutton";
document.getElementById("button3").className = "activemenubutton";
}

document.getElementById("textholder").style.borderTop = "1px solid " + activecolor;
document.getElementById("textholder").style.borderBottom = "1px solid " + activecolor;
document.getElementById("textholder").style.color= activecolor;


$("#textholder").load("Page" + a + ".html");
$( "demo" ).css("border", "1px solid #FFF");

} //end of function

</script>

最佳答案

你错过了句号。 $( ".demo").css("border", "1px solid #FFF");

关于javascript - Jquery 改变类的所有边界,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38485805/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com