javascript - Displaying form data to new tab -
i want display form data new tab using javascript only. not proceeding task. how achieve this?
<!doctype html> <html> <head lang="en"> <meta charset="utf-8"> <script language="javascript"> function showinput() { var message_entered = document.getelementbyid("user_input").value; document.getelementbyid('display').innerhtml = message_entered; } </script> </head> <body> <form> <label><b>enter message</b></label> <input type="text" name="message" id="user_input"> </form> <input type="submit" onclick="showinput();"><br /> <label>your input: </label> <p><span id='display'></span> </p> </body> </html>
var data = "<p>this new tab'</p><br/>"+message_entered; newwindow = window.open("data:text/html," + encodeuricomponent(data), "_blank", "width=200,height=100"); newwindow.focus();
Comments
Post a Comment