/    Sign up×
Community /Pin to ProfileBookmark

Changing content of option box while placing cursor on different picture

can any body tell me, how to change content of option box while placing cursor on different picture, e,g if I move cursor to the picture of tea shrt it related price in the option box or edit box is changed.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@DooloxMar 06.2009 — HTML:
[code=html]
<select id="select">
<option value="test1" id="test1">Test1</option>
<option value="test2" id="test2" selected >Test2</option>
<option value="test3" id="test3">Test3</option>
</select>
<br />
<br />
<br />
<img src="http://www.google.com/intl/en_ALL/images/logo.gif" alt="" onmouseover="change_option('test1');" />
[/code]

JavaScript:
[CODE]
function change_option(id)
{
var sel = document.getElementById('select');
var children = sel.childNodes;
for (var i = 0; i < children.length; i++)
{
if (children[i].selected) children[i].selected = false;
}
document.getElementById('select').selected = true;
}
[/CODE]


If you need any more explanations, ask.
Copy linkTweet thisAlerts:
@sikandarauthorMar 06.2009 — thanx brother! u helped me alot, rest of the concept of instruction I knew. thanx once again.
×

Success!

Help @sikandar 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.6,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...