html - JavaScript: Create Button Along with TextArea -


i quite new javascript/html/css world try bear me.

right now, have created function, inserttext(), when called creates textarea specified div.

however, function create button directly above textarea. have tried use similar method create button did textarea , not receiving error, however, not seeing button either.

function inserttext() { $("text_div") .append(' <textarea placeholder="input value"/> ' ) .append(' <input type="button" name="confirm" value="confirm"/> ') .css({     left: cursor_x + "px",     top: cursor_y + "px", )}; }; 

any thoughts or appreciated, thanks!

edit: more specific , changed title.

you have missplaced ) @ 8th line. should }); instead of )};. code:

function inserttext() {     $("#text_div")     .append(' <textarea placeholder="input value"/> ' )     .append(' <input type="button" name="confirm" value="confirm"/> ')     .css({         left: cursor_x + "px",         top: cursor_y + "px"     }); }; 

working example here: http://jsfiddle.net/dhaud/


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

c# - How do I get the Nth largest element from a list with duplicates, using LINQ? -

jsp - "Sending a redirect is forbidden after the response has been committed" in sendRedirect -