I have a textarea with code of form which the users would copy and paste into their website.
The html in the textarea would be something like this
UPDATE : Note the below form is enclosed in a textarea. This would a plain text in a textarea
<form action="https://www.xxxxxxx.com/servlet/servlet?encoding=UTF-8" method="POST">
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
<input type="submit" name="submit">
</form>
I want to change the url of the form tag to https://www.yyyyyyyyy.com/parse.php and copy the changed form code into another textarea using jquery or normal javascript. Below is the full html
<form>
<textarea rows="10" cols="80" id="oldCode">
<form action="https://www.xxxxxxx.com/servlet/servlet?encoding=UTF-8" method="POST">
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
<input type="submit" name="submit">
</form>
</textarea>
<button onclick="generateCode()">Generate new Code</button>
<textarea id="newCode" rows="10" cols="80">
</textarea>
</form>