Warning: parse_ini_file(/volume1/.env): Failed to open stream: Permission denied in /volume1/web/innstory.com/function_include/config.php on line 33 Warning: Trying to access array offset on value of type bool in /volume1/web/innstory.com/function_include/config.php on line 40 Warning: Trying to access array offset on value of type bool in /volume1/web/innstory.com/function_include/config.php on line 41 Warning: Trying to access array offset on value of type bool in /volume1/web/innstory.com/function_include/config.php on line 42 Warning: Trying to access array offset on value of type bool in /volume1/web/innstory.com/function_include/config.php on line 43 Warning: Trying to access array offset on value of type bool in /volume1/web/innstory.com/function_include/config.php on line 44 Warning: Trying to access array offset on value of type bool in /volume1/web/innstory.com/function_include/config.php on line 45 Warning: Trying to access array offset on value of type bool in /volume1/web/innstory.com/function_include/config.php on line 46 Deprecated: openssl_decrypt(): Passing null to parameter #3 ($passphrase) of type string is deprecated in /volume1/web/innstory.com/private/ukey.php on line 71 javascriptchangecssclass|學習與自我成長|innstory
資料載入中

胡言亂語

  • 0
  • 0°C
  • 7 年又 240 天

javascript change css class


javascriptchangecssclass
使用classList是一個方便的替代方法,可以將元素的類列表作為空格分隔的字符串來訪問。
document.getElementById("MyElement").classList.add('MyClass');
document.getElementById("MyElement").classList.remove('MyClass');
if ( document.getElementById("MyElement").classList.contains('MyClass') )
document.getElementById("MyElement").classList.toggle('MyClass');

不幸的是,這些在Internet Explorer v10之前的版本中不起作用。

但我想這些應該都是已經是不變的事實~所以也不意外了。

Internet Explorer 永遠都是工程師的惡夢( ̄∇ ̄)

  • 使用classList訪問元素類列表
  • Internet Explorer v10之前的版本問題
  • 工程師面對Internet Explorer困擾
  • 空格分隔字符串的使用方法
  • 元素類列表的替代訪問方式
https://innstory.com/story-javascriptchangecssclass-1842

上一篇
 fancyboxclose的方式

下一篇
嘰嘰喳喳 

發表留言

作者簡介

離不開電腦的宅男


推薦閱讀

作者其他相關類別故事

Deprecated: openssl_decrypt(): Passing null to parameter #3 ($passphrase) of type string is deprecated in /volume1/web/innstory.com/private/ukey.php on line 71
Linux下查看版本號指令

Linux下查看版本號指令

0 7 年又 263 天 1.9K

其他指令查詢方式 以上紀錄~

Deprecated: openssl_decrypt(): Passing null to parameter #3 ($passphrase) of type string is deprecated in /volume1/web/innstory.com/private/ukey.php on line 71
Android UI設計距離課題

Android UI設計距離…

0 7 年又 215 天 2.3K

layoutmarginTop指定該屬性所在控件距離上方的位置空間。 layoutmarginBot...

Deprecated: openssl_decrypt(): Passing null to parameter #3 ($passphrase) of type string is deprecated in /volume1/web/innstory.com/private/ukey.php on line 71
PHP無法保存SESSION的問題

PHP無法保存SESSION…

0 5 年又 133 天 1.2K

一天,客戶反應系統後台無法登入。 而這問題是發生在客戶電腦更換了IP位置。 而我這邊也只是開放新的I...