# Java script functions w/user prompts

**URL:** <https://forum.kirupa.com/t/java-script-functions-w-user-prompts/306272>\
**Category:** Uncategorized\
**Created:** [March 12, 2010, 1:00am UTC](https://forum.kirupa.com/t/java-script-functions-w-user-prompts/306272 "2010-03-12T01:00:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![boebarl1](https://avatars.discourse-cdn.com/v4/letter/b/3e96dc/32.png) [@boebarl1](https://forum.kirupa.com/u/boebarl1)\
**Post date:** [March 12, 2010, 1:00am UTC](https://forum.kirupa.com/t/java-script-functions-w-user-prompts/306272/1 "2010-03-12T01:00:30Z")

</div>

I am writing a java script code so that when a user loads a page, they are prompted with a window. Then I will put the user input into a function which will define the size of the users input. I have the window prompt, but cannot figure out how to get the user input concatenated with the \<h1\> tag, here is what I have so far, please give me your thoughts.

\<html xmlns = “[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)”\>  
\<head\>  
\<title\>Using Parameters\</title\>  
\<script type = “text/javascript”\>

var input1 = window.prompt(“Please enter the text that you would like to display for the top Heading.”, “Boe is the King of Java Script!” );

function run( x ) {

```
       document.writeln( "&lt;h1 align = 'left' value=" + input1 + "&gt;" );

       } 
&lt;/script&gt;

```

\</head\>

\<body\>

\<script type=“text/javascript”\>  
run( input1 )

\</script\>  
\</body\>  
\</html\>
