/* create a bootstrap and javascript virtual AI assistant */ var bootstrap = document.createElement('link'); bootstrap.setAttribute('rel', 'stylesheet'); bootstrap.setAttribute('href', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css'); document.head.appendChild(bootstrap); var jquery = document.createElement('script'); jquery.setAttribute('src', 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'); document.head.appendChild(jquery); var bootstrapjs = document.createElement('script'); bootstrapjs.setAttribute('src', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js'); document.head.appendChild(bootstrapjs); var assistant = document.createElement('div'); assistant.setAttribute('class', 'container'); assistant.setAttribute('id', 'assistant'); document.body.appendChild(assistant); var assistant_header = document.createElement('div'); assistant_header.setAttribute('class', 'row'); assistant_header.setAttribute('id', 'assistant_header'); assistant.appendChild(assistant_header); var assistant_header_text = document.createElement('div'); assistant_header_text.setAttribute('class', 'col-sm-8'); assistant_header_text.innerHTML = '<h1>Virtual Assistant</h1>'; assistant_header.appendChild(assistant_header_text); var assistant_header_close = document.createElement('div'); assistant_header_close.setAttribute('class', 'col-sm-4'); assistant_header_close.innerHTML = '<button type="button" class="close" aria-label="Close"><span aria-hidden="true">×</span></button>'; assistant_header.appendChild(assistant_header_close); var assistant_body = document.createElement('div'); assistant_body.setAttribute('class', 'row'); assistant_body.setAttribute('id', 'assistant_body'); assistant.appendChild(assistant_body); var assistant_body_text = document.createElement('div'); assistant_body_text.setAttribute('class', 'col-sm-8'); assistant_body_text.innerHTML = '<p>Hello, I am your virtual assistant. How can I help you?</p>'; assistant_body.appendChild(assistant_body_text); var assistant_body_input = document.createElement('div'); assistant_body_input.setAttribute('class', 'col-sm-4'); assistant_body_input.innerHTML = '<input type="text" class="form-control" id="assistant_input" placeholder="Enter text">'; assistant_body.appendChild(assistant_body_input); var assistant_footer = document.createElement('div'); assistant_footer.setAttribute('class', 'row'); assistant_footer.setAttribute('id', 'assistant_footer'); assistant.appendChild(assistant_footer); var assistant_footer_button = document.createElement('div'); assistant_footer_button.setAttribute('class', 'col-sm-12'); assistant_footer_button.innerHTML = '<button type="button" class="btn btn-default">Submit</button>'; assistant_footer.appendChild(assistant_footer_button);