Exist a great plugin for that http://joshhundley.com/teditable/index.html
On 17 maio, 19:40, Marc Jansen <[EMAIL PROTECTED]> wrote: > Hi, > > just a quick guess: > > isn't focus() a pure DOM method? > > Maybe this works: > > $(this).find("input")[0].focus(); > > [EMAIL PROTECTED] schrieb: > > > > > Hi, > > > I wanted to get some advice on how I can troubleshoot this problem. > > When I click on an particular block of text, I'd like to have that > > text replaced by a editable INPUT text field with the value of the > > text, with the cursor automatically in the text field. Unfortunately, > > the following block inserts the text field properly, but doesn't put > > the focus of the cursor in the text field: > > > $(".tabs-selected .tabText").click( function() { > > var lastParensIndex = $ > > (this).text().lastIndexOf(" ("); > > var item = $(this).html().substring(0, > > lastParensIndex); > > var newHtml = $(this).html().replace(item, > > '<form name="editableTabText" action="javascript:var cwin=$ > > (\'#newTabText\').trigger(\'blur\');"><input id="newTabText" > > type="text" size="10" value="' + item + '"></form>'); > > $(this).empty().append( newHtml ); > > $(this).find("input").focus(); > > } ); > > > Does anyone have any ideas how I might troubleshoot this problem? > > > Thanks, - Dave- Ocultar texto entre aspas - > > - Mostrar texto entre aspas -