運行不了 之前可以運行的 現在按鈕點了沒反應
//定義"改變顏色"的函數
? ? var ray=document.getElementById("txt");
? ? function col(){
? ? txt.style.color="red";
? ? }
//定義"改變寬高"的函數
? ? function wh(){
? ? txt.style.width="300px";
? ? txt.style.height="50px";
? ? }
//定義"隱藏內容"的函數
? ? function no(){
? ? txt.style.display="none"
? ? }
//定義"顯示內容"的函數
? ? function bl(){
? ? txt.style.display="block"
? ? }
//定義"取消設置"的函數
? ? function qx(){
? ? var ra=confirm("是否取消設置")
? ? if ra==true
? ? {
? ? ray.removeAttribute('style');
? ? }
? ? }
? ?
? </script>
2019-06-21
function內的txt要換成ray
2019-06-21
?if ra==true{
?????ray.removeAttribute('style');
}
這里應該改成:
?if (ra==true){
?????ray.removeAttribute('style');
}
按鈕之所以點不了,應該是沒有在
<input type="button" value="改變顏色" onclick="changeColor()">??
? ? <input type="button" value="改變寬高" onclick="changeW_H()">
? ? <input type="button" value="隱藏內容" onclick="HideContent()">
? ? <input type="button" value="顯示內容" onclick="ShowContent()">
? ? <input type="button" value="取消設置" onclick="CancelSet()">
按鈕欄添加對應的響應函數導致的