How can I update the div when clicking on a button via javascript?
<a href="#" id="update">Обновить</a> <div id="content"></div>
Обновить
How can I update the div when clicking on a button via javascript?
<a href="#" id="update">Обновить</a> <div id="content"></div>
What to update?
Somehow conditions are not enough.
So?
function update(){ document.querySelector('#content').innerHTML = 'Обновлено?'; } document.addEventListener('DOMContentLoaded', function(){ document.querySelector('#update').addEventListener('click', update); });
Source: https://ru.stackoverflow.com/questions/413663/
All Articles