ほとんどパクリですんません。
●assert.js
function assert(bbb, disp) { var resulter = document.getElementById("resulter"); if (!resulter) { resulter = document.createElement('ul'); document.getElementsByTagName('body')[0].appendChild(resulter); resulter.setAttribute('id','resulter'); } var li = document.createElement("li"); li.className = bbb ? "pass" : "fail"; var disper = bbb ? "●" + disp : "×" + disp; li.appendChild(document.createTextNode(disper)); resulter.appendChild(li); }●assert.css
ul#resulter { border: 2px ridge maroon; background-color: #ccffcc; padding: 0.25em 1.5em; margin-left: 0; } li.pass { color: #006400; font-weight:bolder;} li.fail { color: #dc143c; text-decoration: line-through; font-weight:bolder;}●sample
●結果
0 件のコメント:
コメントを投稿