Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery createElement then append others inside
    text
    copied!<p>I am trying to customized some OS jQuery to create a div and then add the other "createElement" inside so that I can style with css. I'm out of my depth here and any help would be great. Here is my whack at the code:</p> <pre><code>container = $(doc.createElement(options.containerTagName)).attr({ id: namespace + '-' + element.attr('id'), 'class': options.containerClassName }).insertAfter(element); $(doc.createElement('span')) .appendTo(container) .append(element); uploadwrapper = $(doc.createElement('div')) .attr('class', 'btn_upload_wrapper') .insertAfter(container); $(doc.createElement('input')) .attr(options.buttonAttributes) .attr('type', 'button') .appendTo(uploadwrapper); $(doc.createElement('i')) .attr('class', 'icon-folder-open') .appendTo(uploadwrapper); textElement = $(doc.createElement(options.textTagName)) .attr(options.textAttributes) .appendTo(uploadwrapper); </code></pre> <p>I was able to answer my own question, see below</p> <pre><code>container = $(doc.createElement(options.containerTagName)).attr({ id: namespace + '-' + element.attr('id'), 'class': options.containerClassName }).insertAfter(element); $(doc.createElement('span')) .appendTo(container) .append(element); $(doc.createElement('div')) .attr('class', 'btn_upload_wrapper') .appendTo(container); $(doc.createElement('input')) .attr(options.buttonAttributes) .attr('type', 'button') .appendTo('.btn_upload_wrapper'); $(doc.createElement('i')) .attr('class', 'icon-folder-open') .appendTo('.btn_upload_wrapper'); textElement = $(doc.createElement(options.textTagName)) .attr(options.textAttributes) .appendTo('.btn_upload_wrapper'); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload