Loading...

querySelectorAll對多個相同ID做統一處理

Temperature: 0 °C

ChungChung
author_tools


querySelectorAll對多個相同ID做統一處理
範例,想將同一組ID的DIV做統一隱藏的動作

var elms = document.querySelectorAll("[id='ID名稱']");
for(var i = 0; i < elms.length; i++)
elms[i].style.display='none';

知道使用重複ID並不好,但目前就遇到這樣的情況。

所以只好先使用querySelectorAll來解決此問題。

雖然最後還是因為一些因素不採用此方式~

但還是稍作紀錄.........。

台北市內湖區江南街71巷75弄 Go

https://innstory.com/story-querySelectorAll對多個相同ID做統一處理-1356
寫程式筆記

Prev
 PDO連接Mysql方式

Next
獨自一個人的2個星期第1晚 

Nearby Attractions

台北市內湖區江南街71巷75弄-Nearby Attractions

  • 骨科醫院及住宅 Go
  • 臺灣電力株式會社社長宿舍 Go
  • 士林慈諴宮 Go
  • 蔡瑞月舞蹈研究社 Go
  • 國立臺灣大學日式宿舍-戴運軌... Go
  • 摩耶精舍(張大千園邸) Go

About the Author

Chung

我是chung
網路工作者
主業是網站系統開發建置
副業是做夢,寫故事
作品請參考/teme.biz
做夢請參考/innstory.com
聯絡/chung.teme@gmail.com

#有人用筆寫日記,有人用歲月寫日記,有人用照片寫日記,而我,用innstory寫日記。

Visitor message

Leave some footprints to prove that you visited me

Recommended reading

Author's other related stories

.sql檔過大無法匯入phpMyAdmin

.sql檔過大無法匯入php...

修改phpMyAdmin資料夾中的config.inc.php檔。 打開後找到下列兩行或自行加入: ...

php函式紀錄

php函式紀錄

常常忘記,只得紀錄下來...... AddSlashes: 字符串加入斜線。 binhex: 二進位...

使FCKeditor所上傳的圖檔檔名亂數化

使FCKeditor所上傳的...

編輯"../fckor/or/filemanager/connectors/php/com...

Recommended reading

Other stories happened at this address

已經可以撐那麼高囉,撐住啊5U。

已經可以撐那麼高囉,撐住啊5...

已經可以撐那麼高囉,撐住啊U。

SSL憑證

SSL憑證

pexelsphotossl 終於~為innstory申請了SSL安全憑證。 安裝的過程中出了點狀況...

CSS3 box-shadow

CSS3 box-shado...

便利貼~俗稱小黃(對我來說),依據wiki的說法~是M公司的工程師史賓塞·席佛經過年後出現成果。 那...

排列組合年紀~

排列組合年紀~

s 不知不覺的到了開始喜歡上排列組合遊戲的年紀。 總是把玩具或車車拿到某個角落空間。 然後開始堆疊起...

聖誕節快樂,恩~我想從現在開始一直到農曆新年結束...應該都保持休假心態吧XD

聖誕節快樂,恩~我想從現在開...

聖誕節快樂,恩~我想從現在開始一直到農曆新年結束...應該都保持休假心態吧XD

聽說今天是父親節啊~

聽說今天是父親節啊~

給U吃餅乾~ 結果他把餅乾弄碎了給我當痱子粉抹在身上.... 現在整個身體倒是充滿了千層鬆塔的甜味....

Please select an option

error

Hi, thank you for your participation, but you cannot vote repeatedly~

Join innstory now and start recording your story.

"Innstory" is a place to store stories. We are committed to becoming a warm platform. Deepening the bonds between people is our direction.
We are convinced that the blockchain between people is not just a cold calculation. Join us now.

Wrong format