Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Build an Interactive Form

Xu Cheng
Xu Cheng
5,038 Points

Cannot change display and display: none automatically added

I am trying to do Javascript tech degree project 3: interactive form right now. However I have some issues with "display payment information based on payment selection part".

Initially I hide information about Paypal and Bitcoin, and I try to change it to "inline" after users select that option. However they are still hided. I used Console.log to test and it still shows "display: none".

So I TRY to NOT hide it when I test it. I comment out my initial "paypal.style.display = 'none'; bitcoin.style.display = 'none';" to try(It is not comment out in my code I attach because when I did it I was just trying out and testing out things). While everything shows up initially, when I click on any option, say "paypal", those info disappear ... even though I have no code to may it disappear.

Anyone knows why?

My github link: https://github.com/xu0224/Build-an-Interactive-Form