How to Get Element By Class in JavaScript?

前端 未结 11 2360
南旧
南旧 2020-11-22 01:48

I want to replace the contents within a html element so I\'m using the following function for that:

function ReplaceContentInContainer(id,content) {
   var c         


        
11条回答
  •  悲哀的现实
    2020-11-22 02:26

    var elems = document.querySelectorAll('.one');
    
    for (var i = 0; i < elems.length; i++) {
        elems[i].innerHTML = 'content';
    };

提交回复
热议问题