javascript - Appending a block of CSS upon submit -


I have the following information that removes CSS classes and IDs, and posted them in the console Does. I want to type in a name in the top box, paste some code, and it is to generate a unique CSS id and classes in a new instance of the #classes example (which means uin0CE + A is bunch of squares in it).

I have a posting for the console, I do not know whenever I add new, then how to "spawn" a new example of "code" # class section # codeName and the code is #codeInput .

index.html

  & lt; Div id = "container" & gt; & Lt; Input id = "codename" class = "boxcaskingborder" & gt; & Lt; / Input & gt; & Lt; Br> & Lt; Textarea id = "codeInput" class = "boxcaking border" & gt; & Lt; / Textarea & gt; & Lt; Br> & Lt; Button ID = "Submit code" & gt; Submit & lt; / Button & gt; & Lt; Div id = "classes" & gt; & Lt; Div class = "pageTitle" & gt; Uin0CE & lt; / Div & gt; & Lt; Div class = "cssclassesIDs" & gt; Ui-icon-nodisc, redDotClass, translate, test, ui: hide labels, ui grid-a, ui-block-a, ui-block-b, alignRight, ui grid-single, ui-disabled, companyfieldset, longbutton, Icon-map-marker, location icon, icon-phone, contact icon, legal blocking, legal, legal dividend, signin infix icon, icon-info-mark, UI-icon-alt & lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Script src = "functions.js" & gt; & Lt; / Script & gt; Click the  

functions.js

  $ (function () {$ ('# submitcode') (function () {Var CSS_CLASSES = []; var CSS_IDS = []; var L = document.createElement ('div'); var text = $ ("# codeInput"). Val (); el.innerHTML = text; var nodes = el .getElementsByTagName ('*'); for (var i = 0; i & lt; nodes; height; i ++) {var node = nodes [i]; if (node.id.lamp> gt; 0) { CSS_IDS.push.apply (CSS_IDS, node.indpt ("");} if (node.classname_labby> gt;) {CSS_CLASSES.push.apply (css_classes, node.classname. (""))}}} Var uniqueNames = []; $ .each (CSS_CLASSES, function (i, el) {if ($ .InArray (el, uniqueNames) === -1) Exclamation Push (el) ;}); Console Log (uniqueNames + "---" + unique name length);});});  

Edit: I added it to my Bela:

  // This section was added here var name = $ ('# codeName'). Val (); Var code = Exclusive name; . $ ('# Sections') below (); $ ('#square') Attachment ('& lt; div class = "page title"> gt;' + name + ';); $ ('#square') App ('& lt; div class = "cssClassesIDs" & gt;' + code + '';);  

Updated here:

I hope I am following your question correctly, but it seems like what you want.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -