Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var cars = [
- "Alfa Romeo",
- "BMW",
- "Chevrolet",
- "Dacia"
- ];
- document.getElementById("demo").innerHTML = cars[0];
- document.getElementById("demo").innerHTML = cars[1];
- document.getElementById("demo").innerHTML = cars[2];
- document.getElementById("demo").innerHTML = cars[3];
- //Method 1
- var cars = ["Alfa Romeo", "BMW", "Chevrolet", "Dacia"];
- document.getElementById("demo").innerHTML = cars[0];
- document.getElementById("demo").innerHTML = cars[1];
- document.getElementById("demo").innerHTML = cars[2];
- document.getElementById("demo").innerHTML = cars[3];
- //Method 2
- var car1 = "Alfa Romeo";
- var car2 = "BMW";
- var car3 = "Chevrolet";
- var car4 = "Dacia";
- <script>
- document.write(car1);
- document.write(car2);
- document.write(car3);
- document.write(car4);
- </script>
- //this is to be written in a linked html script
- //Method 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement