This perhaps?
Code:
<div id = "mydiv">Now is the time for all good men to come to the aid of their country.</div>
<div id = "mydiv1"></div>
<script type = "text/javascript">
var ow = ["now", "time","good","men","country"];
var nw = ["tomorrow", "occasion", "fine", "women", "state"];
var txt = document.getElementById("mydiv").innerHTML;
var txtsplit = txt.split(" ");
for (var i =0; i<txtsplit.length; i++) {
for (var j = 0; j <ow.length; j++) {
if (txtsplit[i].toLowerCase() == ow[j]) {
txtsplit[i] = nw[j];
}
}
}
var newtext = txtsplit.join(" ");
newtext = newtext.charAt(0).toUpperCase() + newtext.slice(1); // capitalise first letter of string
document.getElementById("mydiv1").innerHTML = newtext;
</script>
For importing Excel sheet in Javascript see
http://www.roseindia.net/javascript/...ile-data.shtml
But it would be simpler to use a text file. Or just have the words in a Javascript array (as above).
The whole aim of practical politics is to keep the populace alarmed (and hence clamorous to be led to safety)by menacing it with an endless series of hobgoblins, all of them imaginary. - H.L. Mencken 1880-1956, American Editor, Author, Critic, Humorist