Answer the question
In order to leave comments, you need to log in
How to make it so that after adding text, you can delete it (code provided below)?
Hello, tell me what to add to this code so that after creating a note you can also delete it? Thank you very much for your answer))
<body>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<script src='http://code.jquery.com/jquery-latest.js'></script>
<!—
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
-->
<script type='text/javascript'>
function validate_form(){
var name=$('#contact_name').val();
if (name=='') {
} else {
$('#names').append('<p>'+name+'</p>');
};
return false;
}
</script>
</head>
<p></p>
<hr></hr>
<body>
<h4>Заметки:</h4>
<div id='names'></div>
<div class="popup">
<div class="block">
<form name="contact_form" onsubmit="return validate_form();">
<p></p>
<input type="text" name="contact_name" id="contact_name" placeholder="Добавить текст"><br>
<p></p>
<input type="submit" value="Добавить">
</form>
</div>
</div>
</body>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question