P
P
Pavel2015-10-01 16:51:49
JavaScript
Pavel, 2015-10-01 16:51:49

How to display chatbot log/history?

Hello everyone, and here's what we have:

<body>
  <div class='container'>
  <h1>m.ru</h1>
 <p>Вопрос:</p>
 <input class="brd1" type="text" size="30" id="user" onkeydown="ask(event,this);">
 <p>Ответ:</p> 
 <div id='answer' class='answer brd1'>
  </div>
  <h2>Log:</h2>
  <div class='log' id='log'>
  </div>
  </div>
</body>

Q <div class='log' id='log'>I need to display a history of questions / answers, and here's how I imagine it:
<script>
        function doStuff() {
            inputElement = document.getElementById('user');
            answerElement = document.getElementById('answer');
            logElement = document.getElementById('log');
            
        }
    </script>

When using onkeydown="ask(event,this); - The log/history should be displayed.. But it doesn't work.
Need help, thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2015-10-01
@Stalker_RED

An example of the simplest output to a block
jsfiddle.net/ksvzcbnq

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question