form target Attribute - HTML CSS HTML Tag

HTML CSS examples for HTML Tag:form

Description

The target attribute sets where to display the response after submitting the form.

Attribute Values

Value Description
_blankThe response is displayed in a new window or tab
_self The response is displayed in the same frame (this is default)
_parent The response is displayed in the parent frame
_top The response is displayed in the full body of the window
framename The response is displayed in a named iframe

The following code shows how to Display the response received in a new window or tab:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<form action="/action_page.php" method="get" target="_blank">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
</form><!-- ww  w .j  av  a 2s.c o  m-->

</body>
</html>

Related Tutorials