how do i convert this piece of code into javascript function?
<p>i have a form where it has the default value prompting user to enter data.</p>

<p>here is my form.</p>

<pre><code>&lt;input type="text" id="name" name="name" class="input-text" value="Enter Name..." onfocus="if(this.value == 'Enter Name...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Enter Name...';}" /&gt;

&lt;input type="text" id="email" name="email" class="input-text" value="Enter Email Address..." onfocus="if(this.value == 'Enter Email Address...') { this.value = '';}" onblur="if(this.value == '') { this.value ='Enter Email Address...';}"/&gt;

&lt;textarea name="message" id="message" class="input-textarea" onfocus="if(this.value == 'Enter your Message...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Enter your Message...';}"&gt;Enter your Message...&lt;/textarea&gt;
</code></pre>

<p>there are lots of code repeatation here. i want to convert the below code into the javascript function.</p>

<pre><code>onfocus="if(this.value == 'Enter Name...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Enter Name...';}"
</code></pre>

<p>how do i do that?</p>
