1 2 3function addBtnActionDokutts($btn, props, edid) { 4 // initialize stuff if required 5 // ... 6 7 $btn.click(function() { 8 9 10 // your click handler 11 var msg = new SpeechSynthesisUtterance(); 12 msg.text = window.getSelection().toString(); 13 window.speechSynthesis.speak(msg); 14 15 16 return false; 17 }); 18 19 return 'click'; 20} 21 22 23