<!DOCTYPE html>
<html>
<body>

<form id="myForm" action="form_action.asp">
  First name: <input type="text" name="fname" value="Donald"><br>
  Last name: <input type="text" name="lname" value="Duck"><br>
  <input type="submit" value="Submit">
</form>

<p>Click the "Try it" button to set the value of the target attribute in the form to "_blank".</p>

<p><b>Note:</b> Click "Submit" before and after you have clicked on the "Try it"
button.</p>

<button onclick="myFunction()">Try it</button>

<p id="demo"></p>

<script>
function myFunction() {
    document.getElementById("myForm").target = "_blank";
    document.getElementById("demo").innerHTML = "The value of the target attribute was changed.";
}
</script>

</body>
</html>