Text Corrector
About this app
A fun app that corrects text with issues
Text Corrector Text Corrector Correct Text
Related apps
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Text Corrector</title>
<meta name="description" content="A fun app that corrects text with issues">
<meta name="keywords" content="text, corrector, spelling, grammar">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
// This will run when the DOM is ready.
document.addEventListener("DOMContentLoaded", function() {
// Function to correct text
function correctText() {
// Get the input text
var inputText = $('#input-text').val();
// Perform text correction
var correctedText = inputText.replace(/\b(\w+)\b/g, function(match, word) {
// Check if the word is misspelled
if (word === 'teh') {
return 'the';
} else if (word === 'wierd') {
return 'weird';
} else if (word === 'recieve') {
return 'receive';
} else if (word === 'definately') {
return 'definitely';
} else {
return match;
}
});
// Set the corrected text in the output area
$('#output-text').text(correctedText);
}
// Event listener for the Correct Text button
$('#correct-button').click(function() {
correctText();
});
});
} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>
<style>
/* App CSS Goes Here */
body {
background-color: #f8f9fa;
font-family: 'Roboto', sans-serif;
}
.container {
margin-top: 50px;
}
.app-title {
text-align: center;
font-size: 24px;
font-weight: bold;
margin-bottom: 20px;
}
.input-textarea {
width: 100%;
height: 200px;
padding: 10px;
border: 1px solid #ced4da;
border-radius: 5px;
resize: vertical;
}
.output-textarea {
width: 100%;
height: 200px;
padding: 10px;
border: 1px solid #ced4da;
border-radius: 5px;
resize: vertical;
margin-top: 20px;
}
.button-container {
text-align: center;
margin-top: 20px;
}
.correct-button {
padding: 10px 20px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
transition: background-color 0.3s;
}
.correct-button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1 class="app-title">Text Corrector</h1>
<textarea id="input-text" class="input-textarea" placeholder="Type or paste your text here"></textarea>
<div class="button-container">
<button id="correct-button" class="correct-button">Correct Text</button>
</div>
<textarea id="output-text" class="output-textarea" placeholder="Corrected text will appear here" readonly></textarea>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!