I have a div with text inside:
<div id="test">Some text here to edit</div>
When the users clicks on this it needs to change to:
<form name="input" action="html_form_action.asp" method="get">
Edit: <input type="text" name="tex" value="Some text here to edit"/>
<input type="submit" value="Submit" />
</form>
How can I make it so when the user clicks on the text in the div, it will transform into an form/input box like above?
Demo
With HTML and jQuery (a JavaScript framework): http://jsfiddle.net/3qHst/1/.
Additional info
jQuery doc:
.click(),.hide()and.show().Code
html:
jquery: