object(mysqli_result)#13 (5) {
["current_field"]=>
int(0)
["field_count"]=>
int(25)
["lengths"]=>
NULL
["num_rows"]=>
int(1)
["type"]=>
int(0)
}
如何在JavaScript中按Class獲取元素? - 程序員論壇 - Powered by Discuz!
程序員論壇
標題: 如何在JavaScript中按Class獲取元素? [打印本頁]
作者: GreenCup 時間: 2020-8-13 21:41
標題: 如何在JavaScript中按Class獲取元素?
如何在JavaScript中按Class獲取元素?
How to Get Element By Class in JavaScript?- function replaceContentInContainer(matchClass, content) {
- var elems = document.getElementsByTagName('*'), i;
- for (i in elems) {
- if((' ' + elems[i].className + ' ').indexOf(' ' + matchClass + ' ')
- > -1) {
- elems[i].innerHTML = content;
- }
- }
- }
複製代碼
歡迎光臨 程序員論壇 (http://program.thesmartfire.com/) |
Powered by Discuz! X2.5 |