/    Sign up×
Community /Pin to ProfileBookmark

Something interesting for thos who hate quirks!

[CODE]
<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 3.2 Final//EN”>
<html>

<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=windows-1252″>
<title>Examples: Quirks!</title>
<meta name=”GENERATOR” content=”Microsoft FrontPage 6.0″>
<meta name=”ProgId” content=”FrontPage.Editor.Document”>

</head>

<body onload=”document.getElementById(‘radGroup’).value=””>
<form>
<strong>What type of Ad are you interested in?</strong>(Required)<p>

<input TYPE=”radio” NAME=”radGroup” VALUE=”Element 1″ onclick=”document.getElementById(‘radGroup’).value=this.value”>Element 1<br>
<input TYPE=”radio” NAME=”radGroup” VALUE=”Element 2″ onclick=”document.getElementById(‘radGroup’).value=this.value”>Element 2<br>
<input TYPE=”radio” NAME=”radGroup” VALUE=”Element 3″ onclick=”document.getElementById(‘radGroup’).value=this.value”>Element 3<br>

<input type=”button” value=”click” onclick=”javascript: alert(document.getElementById(‘radGroup’).value)”>

</p>
</form>
</body>

</html>
[/CODE]

Give it a go in IE and see if you get the alert to say ‘Element 1’

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangJan 12.2006 — There is no element with id radGroup

Time to move on to HTML 4 ?
Copy linkTweet thisAlerts:
@KorJan 12.2006 — use getElementsByName() instead.
×

Success!

Help @CrazyMerlin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...