Skip to content

Commit c866934

Browse files
authored
Merge pull request #1239 from Nayan2003/main
added enter button key board functinality of chatbot massege send section
2 parents dbe23bd + a09422f commit c866934

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

chatbot.html

+8
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,14 @@
457457
recognition.addEventListener('error', (event) => {
458458
console.error('Speech recognition error:', event.error); // Log any errors
459459
});
460+
461+
document.getElementById("prompt-input").addEventListener("keypress", function(event) {
462+
if (event.key === "Enter") {
463+
event.preventDefault(); // Prevents the default action of the Enter key
464+
document.getElementById("generate-btn").click(); // Programmatically clicks the send button
465+
}
466+
});
467+
460468
</script>
461469
</body>
462470

0 commit comments

Comments
 (0)