Closing Cost Calculator for Seller California

SEO Content Score Analyzer

Check keyword density and readability instantly.

SEO Analysis Report

    function analyzeSEOContent() { var keyword = document.getElementById('focusKeyword').value.trim().toLowerCase(); var content = document.getElementById('contentBody').value.trim(); var resultsDiv = document.getElementById('seoResults'); var scoreMetric = document.getElementById('scoreMetric'); var detailsList = document.getElementById('analysisDetails'); if (!keyword || !content) { alert('Please enter both a focus keyword and content.'); return; } var wordCount = content.split(/\s+/).length; var keywordRegex = new RegExp('\\b' + keyword + '\\b', 'gi'); var keywordCount = (content.match(keywordRegex) || []).length; var density = ((keywordCount / wordCount) * 100).toFixed(2); var score = 0; var details = ""; // Word Count Check if (wordCount > 600) { score += 30; details += "
  • ✅ Good length: " + wordCount + " words.
  • "; } else { score += 15; details += "
  • ⚠️ Short content: " + wordCount + " words (Aim for 600+).
  • "; } // Density Check if (density >= 0.5 && density <= 2.5) { score += 40; details += "
  • ✅ Great keyword density: " + density + "%.
  • "; } else if (density > 2.5) { score += 10; details += "
  • ❌ Keyword stuffing detected: " + density + "%.
  • "; } else { score += 10; details += "
  • ⚠️ Keyword density too low: " + density + "%.
  • "; } // Keyword in First Paragraph (approx) var firstParagraph = content.split('\n')[0].toLowerCase(); if (firstParagraph.indexOf(keyword) !== -1) { score += 30; details += "
  • ✅ Keyword found in introduction.
  • "; } else { details += "
  • ❌ Keyword missing in first paragraph.
  • "; } // Final Display resultsDiv.style.display = 'block'; scoreMetric.innerHTML = "Score: " + score + "/100"; scoreMetric.style.color = score > 70 ? "#27ae60" : (score > 40 ? "#f39c12" : "#e74c3c"); detailsList.innerHTML = details; }

    Leave a Comment