- The write() method writes HTML expressions or JavaScript code to a document.
- The document.writeln() method is similar to write(), only it adds a newline character after each statement.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>HTML EDITOR android app</h1>
<button type="button" onclick="cal_doc();">Call doc function</button>
<script>
function cal_doc()
{
document.write("Sample Text");
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h1>HTML EDITOR android app</h1>
<button type="button" onclick="cal_doc();">Call doc function</button>
<script>
function cal_doc()
{
document.write("Sample Text");
}
</script>
</body>
</html>
What is a document.write:- JavaScript
Reviewed by Network security
on
June 01, 2019
Rating:
No comments: