Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Urgent! How js loops splicing strings
Urgent! How js loops splicing strings
The materials to be prepared are: computer, html editor and browser.

1. First, open the html editor, create a new html file, such as index.html, and fill in a certain amount of input.

2. In index.html

var c =“”;

$('input[name="txt"]')。 each(function () {

If (c! == '') {c += ','; }

C += $ (this). val();

});

document . body . innertext = c;

3. When the browser runs the index.html page, it will print out a string composed of fingers taken from the input.