Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addInput() {
- $("#Editor").append($(container("input")).append($('<input type="text" />')));
- }
- function container(className) {
- container = $('<p class="draggable"></p>');
- $(container).click(function() {
- if(container[0].firstChild != null) {
- // Focus only if there is something in the container box
- container[0].firstChild.focus();
- }
- });
- $(container).addClass(className);
- return container;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement