jquery - Javascript Click function now working -


i trying make new website more interactive have decided lift javascript old website used make body background in css change color when button pressed. have added code new website doesnt work @ all, have no idea why, feel have tried everythink can work correctly,

here html

<input id="bodycolorgreen" type="button" value="green"> 

here javascript

$(document).ready(function () {   $("#bodycolorgreen").click(function () {     $("body").css("background-color", "green"); }); }); 

, css code body is;

body { background-color:black; } 

basically trying when button named "bodycolorgreen" pressed want change page background green.

here linking pages in case have lined them wrong.

<link rel="stylesheet" href="stylesheet.css" type="text/css"> <script type="text/javascript"  src="javascript.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script> 

thankyou help. have spend on hour trying working appreciated.

since script file using jquery, has included first

<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.0.min.js"></script> <script type="text/javascript"  src="javascript.js"></script> 

Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -