spacer
Yehuda Shiran November 30, 2000
Printing the Selected Item
Tips: November 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

One of the advantages of Netscape 6 over Internet Explorer is the ability to print the selected item of a SELECT element. The following drop down menu includes two entries, Al Gore and George W. Bush. Here is the HTML code for this menu:

<SELECT name="presidents">
<OPTION>Al Gore
<OPTION SELECTED>George W. Bush
</SELECT>

The button on the right hand side triggers a call to:

alert(document.election.presidents.value)

Try changing the selection in the drop-down menu. Click the button. In Internet Explorer, the alert box will show up empty. In Netscape 6, the alert box will echo your selection.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint