Javascript examples for DOM HTML Element:Samp
You can create a <samp> element by using the document.createElement() method:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">create a SAMP element with some text</button> <script> function myFunction() {// w w w . ja v a 2 s . c om var x = document.createElement("SAMP"); var t = document.createTextNode("Sample output from a computer program"); x.appendChild(t); document.body.appendChild(x); } </script> </body> </html>