Javascript examples for DOM HTML Element:HR
You can create a <hr> element by using the document.createElement() method:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">create a HR element</button> <script> function myFunction() {/*from ww w.ja v a 2s. co m*/ var x = document.createElement("HR"); document.body.appendChild(x); } </script> </body> </html>