Assign the same text in all the same ID or Class

On my pages it repeats short content like image licenses, or other things. The convenience would also be to be able to edit them all at the same time by typing just one. I know it’s against SEO, but I don’t really care about search engine penalties.
I can’t get this javascript to work. And yet I think I wrote it right.

<script type='text/javascript'>
//<![CDATA[
  var x = document.getElementById("license").document.querySelectorAll("#license");
  var i;
  var text = "Hello world";
    for (i = 0; i < x.length; i++){
     x[i].innerHTML = text; 
  }
//]]> 
</script>