Javascript examples for CSS Style Property:backgroundRepeat
Change the backgroundRepeat property of a DIV element
<!DOCTYPE html> <html> <head> <style> #myDIV {/*from w w w. j a va 2s .com*/ border: 1px solid black; width: 300px; height: 150px; background: url('http://java2s.com/resources/a.png') no-repeat; } </style> </head> <body> <button onclick="myFunction()">Test</button> <div id="myDIV"> <h1>Hello</h1> </div> <script> function myFunction() { document.getElementById("myDIV").style.backgroundRepeat = "repeat-x"; } </script> </body> </html>