為什么我的取消設置按鈕點下去沒有反應
var p1=document.getElementById("txt");
function cancel() {
? ? ? ? var myans=confirm("是否確定取消操作?")
? ? ? ? if (myans==true){
? ? ? ? ? ? p1.removeAttribute=('style');
? ? ? ? }
? ? }
其他幾個按鈕都能按,只有這個一直沒實現,想了很久也不明白是怎么回事,求大神解答
var p1=document.getElementById("txt");
function cancel() {
? ? ? ? var myans=confirm("是否確定取消操作?")
? ? ? ? if (myans==true){
? ? ? ? ? ? p1.removeAttribute=('style');
? ? ? ? }
? ? }
其他幾個按鈕都能按,只有這個一直沒實現,想了很久也不明白是怎么回事,求大神解答
2018-07-15
舉報
2018-07-15
demo.removeAttribute('style');
2018-07-24
.removeAttribute('style');
removeAttribute(指定的屬性) 方法刪除指定的屬性。