find most occuring word from sentence

find most occuring word from sentence

by Simplybj

JavaScript

unction(txtSeoText) {
  var $iframeHolder = $('.iframeHolder');
  txtSeoText = $('#txtSeoText').val();
  var textList = $iframeHolder.text().replace(/\n\s*\n/g, '\n').split('\n');
  var textTosearch = txtSeoText.split(' ');
  var newTextList = [];
  $.each(textList, function(index, value) {
    if (value.length > 0) {
      newTextList.push(value.trim());
      value = value.trim();
    }
  });

  function Check(value, textTosearch) {
    $.each(textTosearch, function(i, v) {
      if (value.indexOf(v)) {
        newTextList.push(v);
      }
    });
  }
}