Change the text of the textarea via JQuery -



Change the text of the textarea via JQuery -

i need create jquery when click alternative of select changes text of textarea alternative value

<p>¿qué frutas te gustan?</p> <form> <select size="6" multiple="multiple"> <option value="naranja">naranja</option> <option value="sandia">sandia</option> <option value="melón">melón</option> <option value="ciruela">ciruela</option> <option value="melocotón">melocotón</option> <option value="plátano">plátano</option> <option value="coco">coco</option> <option value="piña">piña</option> <option value="higo">higo</option> <option value="fresas">fresas</option> </select> <textarea rows="4" cols="60">mis frutas preferidas son: naranja, sandia, melón</textarea> </form>

try this,

<script> function updatetxtarea(ele) { $("#textarea").html($(ele).val()) } </script> <form> <select size="6" onchange="updatetxtarea(this)" multiple="multiple"> <option value="naranja">naranja</option> <option value="sandia">sandia</option> <option value="melón">melón</option> <option value="ciruela">ciruela</option> <option value="melocotón">melocotón</option> <option value="plátano">plátano</option> <option value="coco">coco</option> <option value="piña">piña</option> <option value="higo">higo</option> <option value="fresas">fresas</option> </select> <textarea rows="4" id="textarea" cols="60">mis frutas preferidas son: naranja, sandia, melón</textarea>

jquery

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -