Is it possible to put a JavaScript code within the HTML Form tags. I am trying to achieve something like this:
function abc(abcd) {
document.getElementById("context").innerHTML += "<br> 1:";
document.getElementById("context").innerHTML += "***<form METHOD=POST ACTION=\"/InformationRetrieval/home\">***<input type=\"checkbox\" name=\" GoogleRelevance\" value=\"1\"> Relevant <br><br>";
document.getElementById("context").innerHTML += "<br> 2:";
document.getElementById("context").innerHTML += "<input type=\"checkbox\" name=\" GoogleRelevance1\" value=\"1\"> Relevant <br><br>";
document.getElementById("context").innerHTML += "<br> 3:";
document.getElementById("context").innerHTML += "<input type=\"checkbox\" name=\" GoogleRelevance3\" value=\"1\"> Relevant <br>***<input type=\"submit\" value=\"Submit\"></form>***<br><br>";
}
Here what I am trying to ask in this example is:
I have started the tag initially in my starting 2-3 lines, but I am not closing it there and rather inserting some more javascript lines and in the end I am closing the tag with another <input type="submit">
, but when I click this button it does not work.
I tried using the OnClick
property too but that didn't work either.
I am badly stuck with it. Any help will be greatly appreciated.