Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
jQueryを使用して、テキスト領域内にあるIDを持つhtmlタグ間でテキストを変更するにはどうすればよいですか。
<textarea><div id="tochange">Text</div></textarea>
#tochange内の「テキスト」を変更するにはどうすればよいですか。もちろん、これはtextareaにあるのと同じようにHTMLコードとして表示されます。
$('textarea').val( $('<div />').append( $($('textarea').val()).text('something') ).html() );
フィドル