Skip to content

Instantly share code, notes, and snippets.

@ArtemFedorchuk
Created September 13, 2018 11:58
Show Gist options
  • Select an option

  • Save ArtemFedorchuk/60bbbff163f411f01c69757d12609440 to your computer and use it in GitHub Desktop.

Select an option

Save ArtemFedorchuk/60bbbff163f411f01c69757d12609440 to your computer and use it in GitHub Desktop.
форма заметка
<div class="wraper" style="width: 500px; border: 1px solid tomato; margin: 0 auto; text-align: center; padding: 20px; background: rgba(173, 255, 47, 0.2);">
<form name="form_days">
<h3 style="color: skyblue; margin: 20px 0px;">Дни недели</h3>
<select name="days" >
<option>Понедельник</option>
<option>Вторник</option>
<option>Среда</option>
<option>Четверг</option>
<option>Пятница</option>
<option>Субота</option>
<option>Воскресенье</option>
</select>
<textarea name="message" style="margin-top: 20px" id="" cols="50" rows="4" placeholder="Напишите текст заметки.."></textarea><br>
<input type="button" value="Отправить" onclick="btn_One()">
<input type="button" value="Распечатать" onclick="btn_Two()">
<!-- <button id="btn_1" onclick="btn_One()" class="btn btn-primary" style="margin-top: 30px;">Отправить</button>
<button id="btn_2" onclick="btn_Two()" class="btn btn-warning" style="margin-top: 30px;">Распечатать</button> -->
<div id="form_conspect" style="margin-top: 30px;"></div>
</form>
</div>
<script>
var day = '',
text = '',
i = 1,
arrNotes = [],
form = document.form_days;
function btn_One(){
day = form.days.value;
text = form.message.value;
arrNotes.push(day +' ' + text+ '</br>');
}
function btn_Two(){
document.getElementById('form_conspect').innerHTML = arrNotes;
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment