this query in of questions. got no solution reposting question , can solve dilemma.
i have div.i want div contents editabe. want onlick of button div should turn text box , allow user change contents of div. prefer avoid jquery.
html
<div id="main"> <div id="allowedit">click button edit text <input type="button" value="clk me" onclick="changetext(this)" /> </div> <div>
javascript
changetext = function (e) { src=(e.parentnode); src.outerhtml="<div><input +"+"name=input"+"></div>"; }
you can use html attribute contenteditable
<div contenteditable="true"> text can edited user. </div>
Comments
Post a Comment