Using
$("#input_text").appendTo("#somediv")
Appends the text field itself, I want to append it's value entered by user not itself.
Or if there a way to just use something like ""+valueoffield+", bla bla".
How should I do this?
Thanks.
Using
$("#input_text").appendTo("#somediv")
Appends the text field itself, I want to append it's value entered by user not itself.
Or if there a way to just use something like ""+valueoffield+", bla bla".
How should I do this?
Thanks.
If you need to append the value of your input to #somediv
, what you need to do is:
$( "#somediv" ).append( $( "#input_text" ).val() );
$("#somediv").append($("#input_text").val());
If you would like to keep using appendTo
. You have no option but to use it with some html tag when appending.
$('<span>' + $('#textbox').val() + '</span>').appendTo('#foo');
Try this :
<div id="append">
js:
var append_photo='<img src="{@user_image}" class="img-thumbnail" alt="Thumbnail Image"style="width:125px; height:125px">';
$("#append").append(append_photo.replace("{@user_image}","image/profile_thumb.jpg"));