Javascript examples for DOM HTML Element:BR
The BR object represents an HTML <br> element.
You can access a <br> element by using getElementById():
<!DOCTYPE html> <html> <body> <div> This is a test. This is a test. This is a test. This is a div <br id="myBR"> element with some <br> line breaks. This is a test. This is a test. This is a test. </div>// ww w. ja va 2s. co m <button onclick="myFunction()">Hide the first BR element</button> <script> function myFunction() { var x = document.getElementById("myBR"); x.style.display = "none"; } </script> </body> </html>