Jump to content

Image Roll-Over XHTML STRICT JAVASCRIPT


Guest mash

Recommended Posts

need a bit of help how to make an image rollover with js and make it valid with xhtml STRICT.the basic problem almost is the name attribute that must be changed since it's not valid in xhtml Strict.A working piece of code would be nice Thx in advance.Mash

Link to comment
Share on other sites

this rollover works and is strict xhtml

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>simple document</title></head><body><p><img alt="my rollover" style="height;150px;width:150px" src="http://www.google.co.uk/intl/en_uk/images/logo.gif" onmouseover="javascript: this.src='http://w3schools.invisionzone.com/style_images/w3sbanner.gif'" onmouseout="javascript: this.src='http://www.google.co.uk/intl/en_uk/images/logo.gif'"/></p></body></html>

name will probably have to change to id :)

Link to comment
Share on other sites

They've just left the name attribute around because old browsers don't parse id. But, ID is supposed to be used now.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...