Voice commands are not taken by the browser


Hi! every one, I was working on this project for so long, my problem is for the very first time when I changed a bit of my script, my browser asked to confirm using microphone or not, but it didn't add the commands that I sent though. After that when I refresh my browser it's not even asking me to use microphone to send commands, how will I able to send these commands without knowing whether the microphone is on or not? Please help me out, If any of you find any errors in my code logic. (I have attached my script below)

Thanks in advance!

var template = function(text) {
  return '<p><input type="checkbox"><i class="glyphicon glyphicon-star"></i><span>' + text + '</span><i class="glyphicon glyphicon-remove"></i></p>';

var main = function() {
  $('form').submit(function() {
      var text = $('#todo').val();
    var html = template(text);
    return false;  
$('.list').on('click','.glyphicon-star', function(){
$('.list').on('click','.glyphicon-remove', function(){
        var commands = {
	  'add *listItem': addListItem() 
  var addListItem = function(){
    var html = template(listItem);
 if(confirm("Enable Microphone for voice commands?")){

$(document).ready(main);`Preformatted text`


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.