Need javascript function help inside .js file

I need to modify or fix the output of a function.

so here it is: -----------

this is where it outputs my variable:
<p class="pp_description"></p>
(displays a variable)

this is the one part of the large code(modifies or creates the variable ):
The output that i need to change(or just add something to it): html(unescape(pp_descriptions[set_position])); (how do i modify it to get the output like I need.)

I need to get the output to be like
<input value="$the_output" type="text">
instead of
<p class="pp_description">$the_output</p>
How can I get what I want?

----my knowledge about js---
Tried like adding "things" to it but the html() function outputs the first value, so I need a solution, add something to the function, I never have written javascript myself, so I guess it's easy to people who know javascript more.

Thank you!