It is not mandatory but it is good to have knowledge of basics of HTML & java script for QA engineer
it runs on your computer after you have loaded the web page containing the script.
Here are few examples of what java script can de :
display information based on the time of day
detect the visitor's browser
validate forms data
change page content dynamically
Note: Java script run in the web browser.
2). Java is a statically typed language while java is dynamic.
var age = prompt("enter your age");
document.write("you are adult and your age is " +age);
document.write("You are not adult");
<input type = "button" value = "Submit" onclick = "func()">