css
<style>
input {
color: black;
background-color: aquamarine;
border: 1px solid aqua;
border-radius: 10px;
}
input:hover {
font-weight: 900;
background-color: bisque;
}
</style>
body
<body>
<input type="button" value="我蒋迪没怀孕">
<input type="button" value="我蒋迪没怀孕">
<input type="button" value="我蒋迪没怀孕">
<input type="button" value="我蒋迪没怀孕">
<input type="button" value="我蒋迪没怀孕">
<input type="button" value="我蒋迪没怀孕">
<script>
var btnObjs = document.getElementsByTagName("input");
for (var i = 0; i < btnObjs.length; i++) {
btnObjs[i].onclick = function () {
for (var j = 0; j < btnObjs.length; j++) {
btnObjs[j].value = "我蒋迪没怀孕";
btnObjs[j].style.background = "aquamarine";
}
this.value = "我蒋迪怀孕了";
this.style.background = "red";
}
}
</script>
</body>