netsurf/test/js/event-onclick-insert.html
2019-05-03 08:25:24 +01:00

19 lines
329 B
HTML

<!DOCTYPE html>
<html>
<body>
<button onclick="add_paragraph()">Click me!</button>
<script>
function add_paragraph() {
var paragraph = document.createElement("P");
var textnode = document.createTextNode("New paragraph!");
paragraph.appendChild(textnode);
document.body.appendChild(paragraph);
}
</script>
</body>
</html>