Created
November 29, 2013 23:39
-
-
Save toddwprice/7713409 to your computer and use it in GitHub Desktop.
In accordance with the state of Ohio's boycott of the letter that must not be named, I have created this helpful script to rid your language of all traces of alluded letter.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<textarea id="my-text" style="width:600px;height:100px;">The whole state of Michigan should be on maximum alert.</textarea><br/> | |
<button onclick="ScarletLetter();">Strike Out Bad Letters</button> | |
<div id="result" style="margin-top:20px;"></div> | |
<script type="text/javascript"> | |
function ScarletLetter() | |
{ | |
var myText = document.getElementById('my-text').value; | |
var scarletLetter = '<div style="background:#A9000F;width:12px;height:16px;display:inline-block"> </div>'; | |
myText = myText.replace(/m/g, scarletLetter); | |
myText = myText.replace(/M/g, scarletLetter); | |
document.getElementById('result').innerHTML = myText; | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment