First you have to scan for BT LE devices, the following button triggers the Webbluetooth API scan And let's the user choose the right device
After establishing the connection you can send text messages with the following form
Received Text is automatically displayed in the input field, too