জাভাস্ক্রিপ্ট ব্যবহার করে ডকুমেন্টের কন্টেন্ট রিপ্লেস করার পদ্ধতি শিখতে নিচের কোডটি চালান −
উদাহরণ
<!DOCTYPE html> <html> <body> <p>Click and replace this content.</p> <button onclick = "Display()">Replace</button> <script> function Display() { document.open("text/html","replace"); document.write("<p>Demo text!</p>"); document.close(); } </script> </body> </html>