Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
841 B
2
Indexable
Never
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Test</title>
</head>
<body>

<form id="yorumForm">
	Ad soyad: <input type="text" name="adsoyad" id="adsoyad" required=""> <br>
	Yorum: <textarea id="yorum" name="yorum" required=""></textarea> <br>
	<button type="submit" id="yorumGonder">Yorum Yap</button>
</form>

<hr>

<h3>Yorumlar</h3>
<div class="yorumlar"></div>


<script src="https://code.jquery.com/jquery-3.6.0.js"></script>
<script type="text/javascript">
	$(document).on('submit', '#yorumForm', function(){
		var adsoyad = $("#adsoyad").val();
		var yorum = $("#yorum").val();

		$(".yorumlar").append('<div>Yazan: '+adsoyad+' <br> Yorum: '+yorum+' <br> <button onclick="$(this).parent().remove();">Yorumu sil</button>  <hr> </div>');
		$("#yorumForm").trigger('reset');
		return false;
	});
</script>
</body>
</html>