function words_check() {
  var s=''
  for (var i=0;i<4;i++) {
    var word='';
    var arr=g_word_ids[i];
    for (var j=0;j<4;j++) {
      var id=arr[j];
      var element=document.getElementById(id);
      word=word+element.textContent;
    }
    if (word==g_set[i]) {
      for (var j=0;j<4;j++) {
        var id=arr[j];
        var element=document.getElementById(id);
        element.style.borderColor='green';
        element.style.color='brown';
      }
    } else {
      for (var j=0;j<4;j++) {
        if (word==g_set[j]) {
          s=s+word+' is in the wrong place<br>';
        }
      }
    }
  }
  var element=document.getElementById(message);
  message.innerHTML=s;
}