js changes background_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:15:48
Original
878 people have browsed it

There is a problem with changing the background in js. I use aa.style.background="url(2.jpg)"; there is always something wrong. Please give me some advice. The code is as follows

<!DOCTYPE html><html><head><script>  function fun(){  // var Arr=new Array( "1.jpg ", "2.jpg ")   //  var i=0 ;   var aa=document.getElementById("aa");   aa.style.background="url(2.jpg)";   alert("sdfsdfsdf"); }</script>  </head><body><table width=500 height=100 id= "aa " background="1.jpg" >  <tr> <td>  aaaa  </td> </tr>  </table>  <input type="submit" value="Button" id="bb" onClick="fun();"/></body></html>
Copy after login


Reply to discussion (solution)

Me Made another stupid mistake

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template