Re: changing css bu javascript for all input boxes with the same name
- From: Randy Webb <HikksNotAtHome@xxxxxxx>
- Date: Mon, 08 May 2006 07:56:45 -0400
amykimber@xxxxxxxxx said the following on 5/8/2006 4:12 AM:
Hi guys,
Thanks for all the advice - especially TheBagbournes for reminding me
the .style bit was wrong.
BTW you also said... "Avoid multiple calls to functions just for
efficiency." - groovy, how would you go about this mission - i.e.
changing the style of all input boxes called 'ship_owner[]'?
Richard Cornford said that calling the function from the href wasn't
really the thing to do, so I've gone back to the classic <a href="#"
onClick="change_class('block')" >Block mode</a> - is this still
considered ok?
After you click the link, watch the location bar. It will append # to the URL. You can prevent that by returning false from the onclick event handler:
onclick="change_class('block');return false"
Or better:
onclick="return change_class('block')"
And have the function return true or false.
If the only purpose of the element is to invoke a JS function, use a button instead:
<button onclick="change_class('block')">Block Mode</button>
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
.
- References:
- changing css bu javascript for all input boxes with the same name
- From: amykimber
- Re: changing css bu javascript for all input boxes with the same name
- From: ASM
- Re: changing css bu javascript for all input boxes with the same name
- From: Richard Cornford
- Re: changing css bu javascript for all input boxes with the same name
- From: Marcello
- Re: changing css bu javascript for all input boxes with the same name
- From: Randy Webb
- Re: changing css bu javascript for all input boxes with the same name
- From: amykimber
- changing css bu javascript for all input boxes with the same name
- Prev by Date: Re: Error: document.getElementsByName(userid)[0] has no properties
- Next by Date: Re: OT: nothing to do neither with tea nor China nor private methods in JavaScript
- Previous by thread: Re: changing css bu javascript for all input boxes with the same name
- Next by thread: Re: changing css bu javascript for all input boxes with the same name
- Index(es):
Loading