Click here to Skip to main content
15,889,200 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Having a Problem with Return Value in Javascript Function Pin
Graham Breach12-Nov-13 22:44
Graham Breach12-Nov-13 22:44 
GeneralRe: Having a Problem with Return Value in Javascript Function Pin
Doug Pruiett13-Nov-13 3:30
Doug Pruiett13-Nov-13 3:30 
GeneralRe: Having a Problem with Return Value in Javascript Function Pin
Graham Breach13-Nov-13 5:27
Graham Breach13-Nov-13 5:27 
AnswerRe: Having a Problem with Return Value in Javascript Function Pin
Doug Pruiett13-Nov-13 4:19
Doug Pruiett13-Nov-13 4:19 
GeneralRe: Having a Problem with Return Value in Javascript Function Pin
Richard Deeming13-Nov-13 4:51
mveRichard Deeming13-Nov-13 4:51 
GeneralRe: Having a Problem with Return Value in Javascript Function Pin
Richard MacCutchan13-Nov-13 6:10
mveRichard MacCutchan13-Nov-13 6:10 
SuggestionRe: Having a Problem with Return Value in Javascript Function Pin
chxm199016-Nov-13 3:30
chxm199016-Nov-13 3:30 
QuestionShowing Questions Below Answers After The Submit Button Is Pressed? Pin
KeonD12311-Nov-13 10:25
KeonD12311-Nov-13 10:25 
I've got ten questions here. All questions have two possible answers but only one is correct and I would like to know how to make the answer appear underneath its question after the submit button is pressed. Also sorry if you find some of the questions offensive but that's the kind of demographic I'm trying to reach out to. Anyway here's the code:

XML
<p class="question">1.Would you rather be 2 foot tall or 10 foot tall?</p>
<input id="q1a" type="radio" name="q1" value="a" /><label for="q1a"> 2 foot tall</label>
<input id="q1b" type="radio" name="q1" value="b" /><label for="q1b"> 10 foot tall</label>

<p class="question">2.Would you rather be blind or deaf?</p>
<input id="q2a" type="radio" name="q2" value="a" /><label for="q2a"> Blind</label>
<input id="q2b" type="radio" name="q2" value="b" /><label for="q2b"> Deaf</label>

<p class="question">3.Would you rather be poor and work at a job you love or be rich and work at a job you hate?</p>
<input id="q3a" type="radio" name="q3" value="a" /><label for="q3a"> Poor and love my job</label>
<input id="q3b" type="radio" name="q3" value="b" /><label for="q3b"> Rich and hate your job</label>

<p class="question">4.Would you rather be homeless and have family and friends or not be homeless and live without family?</p>
<input id="q4a" type="radio" name="q4" value="a" /><label for="q4a"> Homeless with family and friends</label>
<input id="q4b" type="radio" name="q4" value="b" /><label for="q4b"> Not homeless without family and friends</label>

<p class="question">5.Would you rather have no legs or no arms?</p>
<input id="q5a" type="radio" name="q5" value="a" /><label for="q5a"> No legs</label>
<input id="q5b" type="radio" name="q5" value="b" /><label for="q5b"> No arms</label>

<p class="question">6.Would you rather have a vagina on your forehead or a penis on your belly-button?</p>
<input id="q6a" type="radio" name="q6" value="a" /><label for="q6a"> Vagina on my forehead</label>
<input id="q6b" type="radio" name="q6" value="b" /><label for="q6b"> Penis on my belly-button</label>

<p class="question">7.Would you rather molest a penguin and nobody knows or not molest a penguin and everyone thinks that you have?</p>
<input id="q7a" type="radio" name="q7" value="a" /><label for="q7a"> Do it and nobody knows</label>
<input id="q7b" type="radio" name="q7" value="b" /><label for="q7b"> Everybody just thinks that you did</label>

<p class="question">8.Would you rather be absolutely freezing, naked, in Antarctica or wear a snowsuit in the desert?</p>
<input id="q8a" type="radio" name="q8" value="a" /><label for="q8a"> Naked in the Antarctica</label>
<input id="q8b" type="radio" name="q8" value="b" /><label for="q8b"> Snowsuit in the desert</label>

<p class="question">9.Would you rather count all the grains of sand on a beach or watch paint dry for 1 hour everyday for the next 10 years?.</p>
<input id="q9a" type="radio" name="q9" value="a" /><label for="q9a"> Count all grains of sand on a beach</label>
<input id="q9b" type="radio" name="q9" value="b" /><label for="q9b"> Watch paint dry everyday for the next 10 years</label>

<p class="question">10.Would you rather have all farts be silent but extremely deadly, it all farts be harmless but extremely loud?</p>
<input id="q10a" type="radio" name="q10" value="a" /><label for="q10a"> Silent but deadly</label>
<input id="q10b" type="radio" name="q10" value="b" /><label for="q10b"> Loud but harmless</label>

<div id="results">Get Answers!</div>
<div id="category1">

<strong>Question 1:</strong> The correct answer is 10 foot because being 10 foot is 5 times better than being 2 foot tall.

</div>
<div id="category2">

<strong>Question 2:</strong> The correct answer is deaf because if you can't see people could be doing anything to you.

</div>
<div id="category3">

<strong>Question 3:</strong> The correct answer is poor and love your job because it's better to be poor and happy than rich and happy. Well that's what I think anyway.

</div>
<div id="category4">

<strong>Question 4:</strong> The correct answer is homeless with family and friends because it's better to be poor and happy than sad and in a medium financial state.

</div>
<div id="category5">

<strong>Question 5:</strong> The correct answer is no legs because if you have no arms you can't do the dirty.

</div>
<div id="category6">

<strong>Question 6:</strong> The correct answer is a penis on your belly-button because you could have it amputated.

</div>
<div id="category7">

<strong>Question 7:</strong> The correct answer is do it and nobody knows. Why would you want people to think that you molested a penguin?

</div>
<div id="category8">

<strong>Question 8:</strong> The correct answer is snowsuit in the desert. You wouldn't want to catch hypothermia as it's worst than hyperthermia, plus that penguin might get you back while you're out there.

</div>
<div id="category9">

<strong>Question 9:</strong> The correct answer is watch paint dry everyday for 1 hour for the next 10 years because if you lose count of the sand half way through counting you'd have to start all over again.

</div>
<div id="category10">

<strong>Question 10:</strong> The correct answer is silent but deadly because you could just blame it on somebody else, nobody will know where it came from.

AnswerRe: Showing Questions Below Answers After The Submit Button Is Pressed? Pin
twseitex12-Nov-13 3:19
twseitex12-Nov-13 3:19 
QuestionHidden field value in javascript Pin
vkEE11-Nov-13 5:12
vkEE11-Nov-13 5:12 
AnswerRe: Hidden field value in javascript Pin
twseitex12-Nov-13 3:27
twseitex12-Nov-13 3:27 
GeneralRe: Hidden field value in javascript Pin
Kornfeld Eliyahu Peter12-Nov-13 19:19
professionalKornfeld Eliyahu Peter12-Nov-13 19:19 
GeneralRe: Hidden field value in javascript Pin
vkEE3-Dec-13 10:35
vkEE3-Dec-13 10:35 
GeneralRe: Hidden field value in javascript Pin
Amir Hamza Md. Kayes6-Dec-13 9:16
professionalAmir Hamza Md. Kayes6-Dec-13 9:16 
QuestionScript to determine the optimal weight man Pin
bosko18-Nov-13 1:11
bosko18-Nov-13 1:11 
SuggestionRe: Script to determine the optimal weight man Pin
Richard MacCutchan8-Nov-13 1:27
mveRichard MacCutchan8-Nov-13 1:27 
GeneralRe: Script to determine the optimal weight man Pin
bosko18-Nov-13 9:47
bosko18-Nov-13 9:47 
GeneralRe: Script to determine the optimal weight man Pin
Richard MacCutchan8-Nov-13 22:51
mveRichard MacCutchan8-Nov-13 22:51 
QuestionTainted Canvas Pin
Paulo Augusto Kunzel31-Oct-13 1:55
professionalPaulo Augusto Kunzel31-Oct-13 1:55 
AnswerRe: Tainted Canvas Pin
enhzflep10-Nov-13 2:49
enhzflep10-Nov-13 2:49 
QuestionIs there any way to avoid activex in javascript ? Pin
nnithiyanand30-Oct-13 0:27
nnithiyanand30-Oct-13 0:27 
AnswerRe: Is there any way to avoid activex in javascript ? Pin
_Maxxx_3-Nov-13 18:34
professional_Maxxx_3-Nov-13 18:34 
Questionneed help to code in java to read a text file...i am beginner in java..pls help me Pin
creativesmart8825-Oct-13 10:46
creativesmart8825-Oct-13 10:46 
AnswerRe: need help to code in java to read a text file...i am beginner in java..pls help me Pin
Richard MacCutchan25-Oct-13 23:06
mveRichard MacCutchan25-Oct-13 23:06 
AnswerRe: need help to code in java to read a text file...i am beginner in java..pls help me Pin
Richard MacCutchan27-Oct-13 23:52
mveRichard MacCutchan27-Oct-13 23:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.