Forcing OnClick

S

Sonnich

Hi!

When I have a checkbox, which migth be set in JS, then I'd like to
trigger the OnClick event on that if possible.

Like:

v.elements.checked= !v.elements.checked;
//here - force the onclik on that

How do I do that?

Sonnich
 
S

Sonnich

Sonnich said:
Hi!

When I have a checkbox, which migth be set in JS, then I'd like to
trigger the OnClick event on that if possible.

Like:

v.elements.checked= !v.elements.checked;
//here - force the onclik on that

How do I do that?


And - when talking of this. Is there a way, just have an OnClick on
some text, without href="#", which makes it scroll to top?

BR
Sonnich
 
E

Evertjan.

Sonnich wrote on 04 jan 2007 in comp.lang.javascript:
Hi!

When I have a checkbox, which migth be set in JS, then I'd like to
trigger the OnClick event on that if possible.

Like:

v.elements.checked= !v.elements.checked;
//here - force the onclik on that

How do I do that?


And - when talking of this. Is there a way, just have an OnClick on
some text, without href="#", which makes it scroll to top?


You would have to click an element, like <span>.

onclick='window.scrollTo(0,0);'

<http://www.w3schools.com/htmldom/met_win_scrollto.asp>
 
J

jodleren

Evertjan. said:
Sonnich wrote on 04 jan 2007 in comp.lang.javascript:
Hi!

When I have a checkbox, which migth be set in JS, then I'd like to
trigger the OnClick event on that if possible.

Like:

v.elements.checked= !v.elements.checked;
//here - force the onclik on that

How do I do that?


And - when talking of this. Is there a way, just have an OnClick on
some text, without href="#", which makes it scroll to top?


You would have to click an element, like <span>.


Would anyone explain a bit here...?
 
E

Evertjan.

jodleren wrote on 12 jan 2007 in comp.lang.javascript:
Would anyone explain a bit here...?
I dont know what to look for, and <span> will probably result in
476547365 results...

"probably"?

So you did not even try?

Before putting your hands on clientside jvascript,
it seems sensible to know the basics of html.

Try: <http://www.w3schools.com/html/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top