Events and multiple-line scripts
Another possible value for an event attributeExtra information added to an element. is the name of a function to be executed. The function definition can be given in an external scriptA JavaScript program..
Note:
Hints:
- undefined
1
2
function addParagraph() {
document.getElementById('answerhere').textContent = 'Text added';
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
<!DOCTYPE html>
<html lang="en">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX