dowp213 Posted January 6, 2011 Share Posted January 6, 2011 how to assign a string to a variable in a if..else?for example:if (condition){(var output="dog")}so that the variable "output" would be displayed after.... Link to comment Share on other sites More sharing options...
abdelelbouhy Posted January 6, 2011 Share Posted January 6, 2011 how to assign a string to a variable in a if..else?for example:if (condition){(var output="dog")}so that the variable "output" would be displayed after....if(condition){ var output = "dog";} Link to comment Share on other sites More sharing options...
jeffman Posted January 6, 2011 Share Posted January 6, 2011 "displayed after" ? If your question has not been answered already, explaining what you mean in these words might help. Link to comment Share on other sites More sharing options...
jeffman Posted January 6, 2011 Share Posted January 6, 2011 BTW, this looks more or less like the same question in this post. In the future, please use just one thread for a single topic. Life will be confusing for you and the board if similar responses are made to more than one thread. Link to comment Share on other sites More sharing options...
thescientist Posted January 6, 2011 Share Posted January 6, 2011 how to assign a string to a variable in a if..else?for example:if (condition){(var output="dog")}so that the variable "output" would be displayed after....like DD hinted, this post seems like kind of a half thought... but I think the second post get's to what you were looking for.. I think. Have you read through the Javascript tutorials?http://www.w3schools.com/js/default.asp Link to comment Share on other sites More sharing options...
shadowayex Posted January 6, 2011 Share Posted January 6, 2011 how to assign a string to a variable in a if..else?for example:if (condition){(var output="dog")}so that the variable "output" would be displayed after....Depending on where you are going to display it, you may want to create the variable outside of the if:var output;if (condition == true){ output = "dog";} As for displaying it, that depends on how/where you want it to display. Looking at the tutorial would be a good idea. If you already have and still don't know how to do it, please explain more of what you're going for. We'll be happy to point you in the right direction, but I doubt anyone will actually give you the full code. Link to comment Share on other sites More sharing options...
dowp213 Posted January 8, 2011 Author Share Posted January 8, 2011 the problem is not with the if..else.. but rather the whole structure of my codes.. but the reply helps really well..the reply really concluded something..I'm new at this,glad that there's always a forum and it's members to help..the admin can close this thread now.. Link to comment Share on other sites More sharing options...
thescientist Posted January 8, 2011 Share Posted January 8, 2011 oh. so what did you really mean to post about? It might be more practical to post a question about the whole problem, so you can get better, more relevant help. If you have an example of your code and what you're trying to do... Link to comment Share on other sites More sharing options...
dowp213 Posted January 8, 2011 Author Share Posted January 8, 2011 oh. so what did you really mean to post about? It might be more practical to post a question about the whole problem, so you can get better, more relevant help. If you have an example of your code and what you're trying to do...here's the thread.. already have Deirdre's Dad up on my thread.. Link to comment Share on other sites More sharing options...
thescientist Posted January 8, 2011 Share Posted January 8, 2011 ah, good deal. I just posted to that thread. Link to comment Share on other sites More sharing options...
dowp213 Posted January 10, 2011 Author Share Posted January 10, 2011 ah, good deal. I just posted to that thread. yeah..thanks a lot for the help..already got it on submission..hoping for a good grade.. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.