add script editor uiCommon.js

This commit is contained in:
fanfuxiaoran 2014-05-04 17:27:27 +08:00
parent 24ffcd6925
commit 9a7af057c1
1 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,14 @@
function createLineWithRadio(lineText, nameAttr) {
var textNode = document.createTextNode(lineText);
var divNode = document.createElement("div");
var inputNode = document.createElement("input");
var brNode = document.createElement("br");
inputNode.setAttribute("type", "radio");
inputNode.setAttribute("name", nameAttr);
inputNode.setAttribute("class", "chooseOnePlugin");
inputNode.setAttribute("value", lineText);
divNode.appendChild(inputNode);
divNode.appendChild(textNode);
divNode.appendChild(brNode);
return $(divNode).html() + "<br>";
}