Jump to content

rigoberto

Neophyte
  • Posts

    1
  • Joined

  • Last visited

rigoberto's Achievements

Explorer

Explorer (1/14)

0

Reputation

  1. Уважаемые программисты, помогите, пожалуйста! у меня есть такая страница: как делать средствами javascript так, чтобы при нажатии на маленькую картинку под большой картинкой появилось значение "alt" той картинки, на которую нажали? Заранее спасибо. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>картинки</title> <script type="text/javascript"> function setBigImage(foto) { document.getElementById("bigimg").src = foto.src; } </script> </head> <body> <div> <p style = 'text-align: center;'> <img id = 'bigimg' src = 'animal.jpg' height = '230' alt = 'animal' /> </p> <table border="0" cellspacing="0" cellpadding="0" align="center" style="border: 1px solid #e2e2e2;"> <tr> <td style="border: 1px solid #e2e2e2;" align="center" class="sm12-center"> <img src = 'animal.jpg' width = '50' onclick = 'setBigImage(this)' alt = 'animal'/> <br><strong>animal</strong> </td> <td style="border: 1px solid #e2e2e2;" align="center" class="sm12-center"> <img src = 'flower.jpg' width = '50' onclick = 'setBigImage(this)' alt = 'flower'/> <br><strong>flower</strong> </td> <td style="border: 1px solid #e2e2e2;" align="center" class="sm12-center"> <img src = 'space.jpg' width = '50' onclick = 'setBigImage(this)' alt = 'space'/> <br><strong>space</strong> </td> </tr> </table> </div> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy