K. Tsang CEng MBCS PMP PMI-ACP OCMJEA OCPJP
Bear Bibeault wrote:Please read NotACodeMill.
jQuery is perfect for this type of thing. Give it a try and post with any problems you are having. But you write the code. We just help you with it.
Sultan Altoobi wrote:here is my code, but its not working!!
K. Tsang wrote:The show/hide stuff usually done with JavaScript.
One simple way is to set a "onClick" action for the "other" option and trigger the show function. The other options will equally need to trigger the JS by calling the hide function.
Bear Bibeault wrote:Two problems with this (and its counterpart) line: $('other').css('display', 'block');
Why are you not using .show() and .hide()? What is it that you think that your selector is matching?
Bear Bibeault wrote:More: on this line:
It's bad form to mix the styles in with the markup. Move the style info to a <style> element.
Bear Bibeault wrote:The most important question I asked is about the selectors. I ask again: do you really think that your selectors are selecting what you think they are selecting? Are you using the correct selector syntax?
Are you using the JavaScript debuggers built into the browsers? If not, why not? Debugging JavaScript without a debugger is like trying to play concert piano while wearing welding gloves.
Bear Bibeault wrote:
Now before you do one more line of coding, learn how to use the debugger in the browser! Do it now! It will save you hours and hours of time in the future.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |