HI have a simple need to generate a new window with the contents of a textarea. Based on which type of formatting a user wants, they can push a button to alter some of the textarea 'text' to suit their needs. But I am having trouble with implementing the .replace command - though I've tried to follow examples on this forum.
<body>
<div id="diagoutput"> </div>
<a onclick="combine()" href="report_output.html" id="link" target="_blank"><input type="button" value="Generate a report window"><br>
<textarea rows="10" cols="40" placeholder="Diagnosis" id="outPut3">I love the sun devils</textarea><br>
</body>
And here is my js snippet that is not replacing the intended text
function combine(){
var diag=$("#outPut3").text().replace(/sun devils/g, "WILDCATS");
var textToPass=' \nNEW TEXT:\n'+diag.value;
localStorage.setItem("myText", textToPass);
};
I'm new with jQuery, so some of my attempts to copy what others have done may be a bit crude.
I appreciate any help, ck