Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8">
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
- <title>M</title>
- <script type="text/javascript">
- $(document).ready(function(){
- $('#peshka').bind("click",function(){
- if($('#peshka').val() == 'Turn it on'){
- $('#img').attr('src','img/OnLamp.png');
- $('#peshka').attr('value','Turn it off');
- }
- else {
- $('#img').attr('src','img/OffLamp.ico');
- $('#peshka').attr('value','Turn it on');
- }
- });
- });
- </script>
- </head>
- <body>
- <p><img src="img/OffLamp.ico" id="img" width="90px" height="90px"></p>
- <input type="button" id="peshka" value="Turn it on">
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement