On Oct 29, 4:57 pm, Nic Hubbard <[EMAIL PROTECTED]> wrote: > I am using the jquery each() function to find the id of text areas on > my page. Then I need to add that id next to another function, but I > am getting syntax errors: > > $('textarea').each(function() { > var textId = $(this).attr('id'); > $(this).val(); = eval('editor_' + textId + '.getHTML();'); > }); > > Am I right in using eval to add the id? Or am I going about this the > wrong way?
Not clear on what you're trying to do, exactly. OK, so you have a bunch of TEXTAREAs on a page and you want to grab their respective IDs and... do what with them? Let's say one has an ID of "color." What is editor_color.getHTML()?? One thing I see wrong: > $(this).val(); = eval('editor_' + textId + '.getHTML();'); That's bad syntax. You have an erroneous semicolon after val(), and besides, you set a value like this: $(this).val('my value'); Not like this: $(this).val() = 'my value';