I am creating a chat but the input where the message is written will self-clean before sending the message follows the code to give me a hand of what can be, if in case you need more details put the complete code
script
$(function() {
afficheConversation();
$('#envoyer').click(function() {
var nom = $('#nom').val();
var message = $('#message').val();
$.post('chat.php', {'nom':nom, 'message': message }, function() {
afficheConversation;
});
});
function afficheConversation() {
$('#conversation').load('chatlog.htm');
$('#message').val('');
$('#message').focus();
}
setInterval(afficheConversation, 3000);
});