Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<style type="text/css">
#input_container {
width: 200px;
text-align: right;
}
#input_container input {
margin: 0 5px;
}
.hide {
visibility: hidden;
}
</style>
<script type="text/javascript">
function CreateEraseInput() {
var root=document.forms['root'];
var input_con=document.getElementById('input_container');
var create=root.elements['create'];
var erase=root.elements['erase'];
var i=2;
create.onclick=function () {
with (document) {
var label=createElement('label');
label.innerHTML='Field '+i;
var input=createElement('input');
input.type='text';
input.name='Field '+i;
var br=createElement('br');
}
input_con.appendChild(label);
input_con.appendChild(input);
input_con.appendChild(br);
erase.style.visibility='visible';
if (i>=9) {
this.style.visibility='hidden';
}
i++;
}
erase.onclick=function () {
for (j=0;j<3;j++) {
input_con.removeChild(input_con.lastChild);
}
create.style.visibility='visible';
if (i<=3) {
this.style.visibility='hidden';
}
i--;
}
}
window.onload=CreateEraseInput;
</script>
<form name="root" action="">
<div id="input_container">
<label>Field 1</label><input type="text" name="input1">
</div>
<input type="button" name="create" value="Добави поле">
<input class="hide" type="button" name="erase" value="Изтрий поле">
</form>