The owner of all other objects in your web page is HTML DOM document object. It represents web pages. If you want to access html element you have start accessing with document object. Finding HTML Elements Method Description document.getElementById(id) Find an element by element id document.getElementsByTagName(name) Find elements by tag name document.getElementsByClassName(name) Find elements by class name Changing HTML Elements Method Description element.innerHTML = new...
These methods are actions you can perform on HTML Elements and the properties are values of HTML Elements that you can set or change. OUTPUT : My First Page
Constraint Validation DOM Methods There are two methods : 1. checkValidity() 2. setCustomValidity() OUTPUT : Enter a number and click OK: OK If the number is less than 200 or greater than 400, an error message will be displayed.
Addition means adding numbers, while Concatenation means adding strings. But the same thing is both operation use + oprator. OUTPUT : Adding number + string.