removeAttribute
//定義"取消設(shè)置"的函數(shù)
function resettext(){
? ? var mychose = confirm();
? ? if(mychose==true){
? ? ? ?mydiv.removeAttribute("style");
removeAttribute是刪除指定的屬性,請(qǐng)問是刪除指定的那一段程序,還有g(shù)etattribute跟這個(gè)有什么區(qū)別呢
//定義"取消設(shè)置"的函數(shù)
function resettext(){
? ? var mychose = confirm();
? ? if(mychose==true){
? ? ? ?mydiv.removeAttribute("style");
removeAttribute是刪除指定的屬性,請(qǐng)問是刪除指定的那一段程序,還有g(shù)etattribute跟這個(gè)有什么區(qū)別呢
2016-11-23
舉報(bào)
2016-11-23
?mydiv.removeAttribute("style");刪除的是mydiv上面的style屬性;
mydiv.getAttribute("style")是獲取mydiv的style屬性
2016-11-23
可以自己試一下