Load image into a div
Load image into a div
How can I complete this code below to make the image links show up inside the div? Also, if the div already has an image inside it, then clicking a new image link should replace the current contents of the div.
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Load image into div</title>
- <script type="text/javascript"
- src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- //To do
- });
- </script>
- </head>
- <body>
- <a href="picture.jpg" class="sideLoad">Link to image</a>
- <a href="picture1.jpg" class="sideLoad">Link to image 1</a>
- <a href="picture2.jpg" class="sideLoad">Link to image 2</a>
- <div id="imageBox">
- </div>
- </body>
- </html>