Click here to Skip to main content
15,885,546 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Second chart not react to data entered, why? Explain, please, how to solve the issue? Pin
Pete O'Hanlon28-Sep-22 4:26
mvePete O'Hanlon28-Sep-22 4:26 
QuestionWhy doesn't this script work as expected? Pin
DSB Audio (David Sweeney-Bear)24-Sep-22 3:39
DSB Audio (David Sweeney-Bear)24-Sep-22 3:39 
AnswerRe: Why doesn't this script work as expected? Pin
DSB Audio (David Sweeney-Bear)24-Sep-22 7:43
DSB Audio (David Sweeney-Bear)24-Sep-22 7:43 
AnswerRe: Why doesn't this script work as expected? Pin
Richard Deeming25-Sep-22 21:42
mveRichard Deeming25-Sep-22 21:42 
GeneralRe: Why doesn't this script work as expected? Pin
DSB Audio (David Sweeney-Bear)30-Sep-22 4:16
DSB Audio (David Sweeney-Bear)30-Sep-22 4:16 
GeneralRe: Why doesn't this script work as expected? Pin
DSB Audio (David Sweeney-Bear)30-Sep-22 4:31
DSB Audio (David Sweeney-Bear)30-Sep-22 4:31 
AnswerRe: Why doesn't this script work as expected? Pin
Jeremy Falcon26-Oct-22 11:36
professionalJeremy Falcon26-Oct-22 11:36 
QuestionCan sending a large number of requests to the server cause any performance issues on the server? Pin
Alex Wright 202221-Sep-22 8:33
Alex Wright 202221-Sep-22 8:33 
AnswerRe: Can sending a large number of requests to the server cause any performance issues on the server? Pin
Richard Deeming21-Sep-22 21:40
mveRichard Deeming21-Sep-22 21:40 
QuestionMultiple popup windows - information is the same in all of them Pin
BartekDD21-Sep-22 2:02
BartekDD21-Sep-22 2:02 
QuestionOne big collection or nested collections Pin
waldette 202214-Sep-22 11:35
waldette 202214-Sep-22 11:35 
AnswerRe: One big collection or nested collections Pin
Pete O'Hanlon14-Sep-22 20:54
mvePete O'Hanlon14-Sep-22 20:54 
GeneralRe: One big collection or nested collections Pin
waldette 202215-Sep-22 6:13
waldette 202215-Sep-22 6:13 
QuestionPinch zoom in zoom out in js Pin
madhuri jawadekar11-Sep-22 20:01
madhuri jawadekar11-Sep-22 20:01 
Questionhow to make campaign windows Pin
Member 157551811-Sep-22 20:22
Member 157551811-Sep-22 20:22 
AnswerRe: how to make campaign windows Pin
Richard MacCutchan1-Sep-22 22:02
mveRichard MacCutchan1-Sep-22 22:02 
AnswerRe: how to make campaign windows Pin
Dave Kreskowiak2-Sep-22 12:56
mveDave Kreskowiak2-Sep-22 12:56 
QuestionIs there a way to input a unique number for each array output? Pin
machinewraith31-Aug-22 15:46
machinewraith31-Aug-22 15:46 
I am trying to number each result so that it says:

City #1 is Los Angeles.
City #2 is...
City #3 is...
... and so on.

I was thinking that I had to write something inside the for loop?

<html>
 
<body style="text-align: center;">
 
	<h2 id="hi">Enter Your Five Favorite Cities</h2>
	<form class="" action="index.html">
        <input type="text" name="favoriteCities[]" value="" /><br>
        <br>
		<input type="text" name="favoriteCities[]" value="" /><br>
        <br>
		<input type="text" name="favoriteCities[]" value="" /><br>
        <br>
		<input type="text" name="favoriteCities[]" value="" /><br>
        <br>
		<input type="text" name="favoriteCities[]" value="" /><br>
	<br>
        <button type="button" name="button" onclick="favoriteCities()">Submit</button>
   
    </form>
 
	<h3 id="hi">Results</h3>
 
    <p id="output"></p>
    
	<script type="text/javascript">
        var r = "";
        function favoriteCities() {
            var input = document.getElementsByName('favoriteCities[]');
 
            for (var i = 0; i < input.length; i++) {
                var a = input[i];
                r = r + "City #" + "???" + "is " + a.value + ("<br>");
            }
            document.getElementById("output").innerHTML = r;
        }
    </script>
	
	
</body>
 
</html>


I am using Notepad++.
AnswerRe: Is there a way to input a unique number for each array output? Pin
Richard Deeming1-Sep-22 22:23
mveRichard Deeming1-Sep-22 22:23 
Questionjavascript looping pattern question Pin
ravindra Yadav 202213-Aug-22 1:22
ravindra Yadav 202213-Aug-22 1:22 
AnswerRe: javascript looping pattern question Pin
Richard MacCutchan13-Aug-22 1:31
mveRichard MacCutchan13-Aug-22 1:31 
QuestionJavascript Pin
User 1567076229-Jul-22 0:20
User 1567076229-Jul-22 0:20 
AnswerRe: Javascript Fibonacci sequence Pin
Richard MacCutchan29-Jul-22 3:28
mveRichard MacCutchan29-Jul-22 3:28 
RantRe: Javascript Pin
Richard Deeming1-Aug-22 0:29
mveRichard Deeming1-Aug-22 0:29 
QuestionI need help in defining and calling Static variable in Typescript. Pin
Afi_sh26-Jul-22 5:01
Afi_sh26-Jul-22 5:01 

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.