Why does my code not work? Shouldn't it print \[code\]222\[/code\] to the element with ID \[code\]p2\[/code\]?\[code\]<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%><%@page import="java.io.*" %><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Insert title here</title><script type="text/javascript">function compareData(){document.getElementById('p1').innerHTML = "111";var inputs = document.getElemementsByTagName("input");// why can't I display the "222" here??document.getElementById('p2').innerHTML = "222";}</script></head><body><p id="p1"> a </p><p id="p2"> b </p><input type="button" onclick="compareData()" value="http://stackoverflow.com/questions/12776928/hello"/> </body></html> \[/code\]