Skip to content

Commit

Permalink
Merge pull request #1239 from Nayan2003/main
Browse files Browse the repository at this point in the history
added enter button key board functinality of chatbot massege send section
  • Loading branch information
vimistify authored Nov 11, 2024
2 parents dbe23bd + a09422f commit c866934
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chatbot.html
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,14 @@
recognition.addEventListener('error', (event) => {
console.error('Speech recognition error:', event.error); // Log any errors
});

document.getElementById("prompt-input").addEventListener("keypress", function(event) {
if (event.key === "Enter") {
event.preventDefault(); // Prevents the default action of the Enter key
document.getElementById("generate-btn").click(); // Programmatically clicks the send button
}
});

</script>
</body>

Expand Down

0 comments on commit c866934

Please sign in to comment.