Advertisement
Guest User

Untitled

a guest
Apr 20th, 2015
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. function addInput() {
  2. $("#Editor").append($(container("input")).append($('<input type="text" />')));
  3. }
  4.  
  5. function container(className) {
  6. container = $('<p class="draggable"></p>');
  7. $(container).click(function() {
  8. if(container[0].firstChild != null) {
  9. // Focus only if there is something in the container box
  10. container[0].firstChild.focus();
  11. }
  12. });
  13. $(container).addClass(className);
  14.  
  15. return container;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement