How to use DOM Object Open in JavaScript
In this article I am going to explain about DOM object open() method in JavaScript.
JavaScript DOM Object Open() Method
JavaScript open() method use for open an new page and collect output from document.write() method or document.writeln() method and result will be display on new page.
Syntax
Example
<html>
<head>
<script type="text/javascript">
function myfun() {
var mm = document.getElementsByName("Add");
alert(mm.length);
}
</script>
</head>
<body>
<h4 name="Add">
Shayam</h4>
<h4 name="Add">
Ajay</h4>
<h4 name="Add">
Abhishek</h4>
<button onclick="myfun()">
click me</button>
</body>
</html>
|
Output
Before Click
After Click
You may also want to read these related articles: here
Ask Your Question
Got a programming related question? You may want to post your question here