-
Notifications
You must be signed in to change notification settings - Fork 0
/
rule.js
39 lines (29 loc) · 729 Bytes
/
rule.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function breakIt()
{
//Counter
var i = 0;
//ATTENTION:No parse error even without body, but will not work without semicolon
while(split(i++));
}
//Splits the string in separated characters
function split(i)
{
//Preparing all Elements
var usrInput = document.getElementById('user_input').value;
var tag = document.createElement('LI');
var node = document.createTextNode(usrInput.charAt(i));
var result = document.getElementById('result');
if(i === usrInput.length)
{
alert("DONE!");
//When all string characters were iterated
return false
}
else
{
//Create new tag and put a string character as tag-content
tag.appendChild(node);
result.appendChild(tag);
return true;
}
}