I'm currently working on a code that displays what a user is typing and then echoes that input into an HTML document. Here's the code snippet:
<html><head>
<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script src="jquery.zclip.js"></script>
<style> body{font-family:century gothic;}</style>
</head>
<body style="zoom: 1;">
<div style="padding:10%;">
<textarea type="text" name="fname" class="chatinput" style="margin: 0px; width: 977px; height: 324px;"> </textarea>
<div style="padding-top:10%;" class="printchatbox"></div>
<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
<script src="jquery.zclip.js"></script>
<script type="text/javascript">
$('.chatinput').keyup(function(event) {
newText = event.target.value;
$('.printchatbox').text(newText);
});
</script>
I need help in figuring out how to dynamically replace a word or phrase with something else while the user is typing. For example, if the user types "this is a string," I want the program to automatically change it to "This is a text" as it appears in the HTML document. Any assistance would be greatly appreciated!