11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

src="../images/button.gif" alt="Submit" />><br />

<strong>The</strong> unique properties of image buttons are discussed in Table 14-4. In particular, notice that<br />

image maps can be used with image buttons via the usemap attribute. Yet, interestingly,<br />

regardless of the use of a usemap attribute, image-based Submit buttons always send an x<br />

and y value in during submission, indicating the pixel coordinates of the image clicked.<br />

Table 14-4: Additional Properties of Inputs of Type "image"<br />

Property Description<br />

Alt Text alternative of the button for non-visual browsers<br />

Src URL of the image to display as a button<br />

UseMap Indicates the button is a client-side image map<br />

Note Despite being defined since HTML 4, the image button is often not supported by older<br />

browsers. Even relatively recent browsers such as Internet Explorer 5 do not properly<br />

recognize it.<br />

Generalized Buttons<br />

HTML 4 and XHTML support the tag, which is much more flexible than <br />

and provides the possibility of visually richer buttons. <strong>The</strong> basic syntax of the tag is<br />

presented here:<br />

<br />

Two examples of in use are shown here:<br />

<br />

Yes sir, I am a submit button!<br />

<br />

<br />

<br />

<br />

Renderings unfortunately might not be as expected:<br />

Supporting the basic syntax and previous example, DOM Level 1 defines the expected<br />

properties for the HTMLButtonElement object shown in Table 14-5.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!